From 10c2aebe6dd8cfd357043c1edec355eb96d864a0 Mon Sep 17 00:00:00 2001 From: tison Date: Wed, 17 Apr 2024 05:35:19 +0800 Subject: [PATCH] style: supports to support Signed-off-by: tison --- src/lib.rs | 12 ++++++------ tests/custom-panic/src/main.rs | 2 +- 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/src/lib.rs b/src/lib.rs index a8b2ff9..281ad53 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -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`]. @@ -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, } }}; } @@ -102,7 +102,7 @@ macro_rules! metadata { /// let mut metadata = metadata!(); /// metadata.authors = Some("My Company Support ".into()); /// metadata.homepage = Some("www.mycompany.com".into()); -/// metadata.supports = Some("- Open a support request by email to support@mycompany.com".into()); +/// metadata.support = Some("- Open a support request by email to support@mycompany.com".into()); /// setup_panic!(metadata); /// ``` #[macro_export] @@ -188,7 +188,7 @@ fn write_msg>( name, authors, homepage, - supports, + support, .. } = meta; @@ -216,8 +216,8 @@ fn write_msg>( 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, diff --git a/tests/custom-panic/src/main.rs b/tests/custom-panic/src/main.rs index 5175379..418f0cc 100644 --- a/tests/custom-panic/src/main.rs +++ b/tests/custom-panic/src/main.rs @@ -6,7 +6,7 @@ fn main() { metadata.version = env!("CARGO_PKG_VERSION").into(); metadata.authors = Some("My Company Support