Skip to content

Commit

Permalink
style: supports to support
Browse files Browse the repository at this point in the history
Signed-off-by: tison <[email protected]>
  • Loading branch information
tisonkun committed Apr 16, 2024
1 parent f28307b commit 10c2aeb
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 7 deletions.
12 changes: 6 additions & 6 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -67,7 +67,7 @@ pub struct Metadata {
/// The URL of the crate's website
pub homepage: MaybeString,
/// The support information
pub supports: MaybeString,
pub support: MaybeString,
}

/// Initialize [`Metadata`].
Expand All @@ -79,7 +79,7 @@ macro_rules! metadata {
name: env!("CARGO_PKG_NAME").into(),
authors: Some(env!("CARGO_PKG_AUTHORS").replace(":", ", ").into()),
homepage: None,
supports: None,
support: None,
}
}};
}
Expand All @@ -102,7 +102,7 @@ macro_rules! metadata {
/// let mut metadata = metadata!();
/// metadata.authors = Some("My Company Support <[email protected]>".into());
/// metadata.homepage = Some("www.mycompany.com".into());
/// metadata.supports = Some("- Open a support request by email to [email protected]".into());
/// metadata.support = Some("- Open a support request by email to [email protected]".into());
/// setup_panic!(metadata);
/// ```
#[macro_export]
Expand Down Expand Up @@ -188,7 +188,7 @@ fn write_msg<P: AsRef<Path>>(
name,
authors,
homepage,
supports,
support,
..
} = meta;

Expand Down Expand Up @@ -216,8 +216,8 @@ fn write_msg<P: AsRef<Path>>(
if let Some(authors) = authors {
writeln!(buffer, "- Authors: {authors}")?;
}
if let Some(supports) = supports {
writeln!(buffer, "\nTo submit the crash report:\n\n{supports}")?;
if let Some(support) = support {
writeln!(buffer, "\nTo submit the crash report:\n\n{support}")?;
}
writeln!(
buffer,
Expand Down
2 changes: 1 addition & 1 deletion tests/custom-panic/src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,7 @@ fn main() {
metadata.version = env!("CARGO_PKG_VERSION").into();
metadata.authors = Some("My Company Support <[email protected]".into());
metadata.homepage = Some("www.mycompany.com".into());
metadata.supports = Some("- Open a support request by email to [email protected]".into());
metadata.support = Some("- Open a support request by email to [email protected]".into());
setup_panic!(metadata);

println!("A normal log message");
Expand Down

0 comments on commit 10c2aeb

Please sign in to comment.