From cee21976ecc615b709b0548180dd1724ba591d97 Mon Sep 17 00:00:00 2001 From: baoyachi Date: Sat, 19 Mar 2022 23:14:28 +0800 Subject: [PATCH] fix cargo clippy --- example_shadow/src/main.rs | 2 +- src/gen_const.rs | 12 ++++++------ 2 files changed, 7 insertions(+), 7 deletions(-) diff --git a/example_shadow/src/main.rs b/example_shadow/src/main.rs index b1ca73d..3e00664 100644 --- a/example_shadow/src/main.rs +++ b/example_shadow/src/main.rs @@ -6,7 +6,7 @@ shadow!(build); fn main() { Command::new("example_shadow") - .version(build::clap_long_version()) + .version(build::CLAP_LONG_VERSION) .get_matches(); //USAGE: ./example_shadow -V // shadow-rs built in function diff --git a/src/gen_const.rs b/src/gen_const.rs index cd5b394..36ce446 100644 --- a/src/gen_const.rs +++ b/src/gen_const.rs @@ -7,7 +7,7 @@ macro_rules! gen_const { } const VERSION_BRANCH_CONST: &str = r##"#[allow(dead_code)] -pub const VERSION:&'static str = shadow_rs::const_format::formatcp!(r#" +pub const VERSION:&str = shadow_rs::const_format::formatcp!(r#" pkg_version:{} branch:{} commit_hash:{} @@ -16,7 +16,7 @@ build_env:{},{}"#,PKG_VERSION, BRANCH, SHORT_COMMIT, BUILD_TIME, RUST_VERSION, R );"##; const VERSION_TAG_CONST: &str = r##"#[allow(dead_code)] -pub const VERSION:&'static str = shadow_rs::const_format::formatcp!(r#" +pub const VERSION:&str = shadow_rs::const_format::formatcp!(r#" pkg_version:{} tag:{} commit_hash:{} @@ -26,7 +26,7 @@ build_env:{},{}"#,PKG_VERSION, TAG, SHORT_COMMIT, BUILD_TIME, RUST_VERSION, RUST const CLAP_VERSION_BRANCH_CONST: &str = r##"#[allow(dead_code)] #[deprecated = "Replaced with `CLAP_LONG_VERSION`"] -pub const CLAP_VERSION:&'static str = shadow_rs::const_format::formatcp!(r#"{} +pub const CLAP_VERSION:&str = shadow_rs::const_format::formatcp!(r#"{} branch:{} commit_hash:{} build_time:{} @@ -35,7 +35,7 @@ build_env:{},{}"#,PKG_VERSION, BRANCH, SHORT_COMMIT, BUILD_TIME, RUST_VERSION, R const CLAP_VERSION_TAG_CONST: &str = r##"#[allow(dead_code)] #[deprecated = "Replaced with `CLAP_LONG_VERSION`"] -pub const CLAP_VERSION:&'static str = shadow_rs::const_format::formatcp!(r#"{} +pub const CLAP_VERSION:&str = shadow_rs::const_format::formatcp!(r#"{} tag:{} commit_hash:{} build_time:{} @@ -43,7 +43,7 @@ build_env:{},{}"#,PKG_VERSION, TAG, SHORT_COMMIT, BUILD_TIME, RUST_VERSION, RUST );"##; const CLAP_LONG_VERSION_BRANCH_CONST: &str = r##"#[allow(dead_code)] -pub const CLAP_LONG_VERSION:&'static str = shadow_rs::const_format::formatcp!(r#"{} +pub const CLAP_LONG_VERSION:&str = shadow_rs::const_format::formatcp!(r#"{} branch:{} commit_hash:{} build_time:{} @@ -51,7 +51,7 @@ build_env:{},{}"#,PKG_VERSION, BRANCH, SHORT_COMMIT, BUILD_TIME, RUST_VERSION, R );"##; const CLAP_LONG_VERSION_TAG_CONST: &str = r##"#[allow(dead_code)] -pub const CLAP_LONG_VERSION:&'static str = shadow_rs::const_format::formatcp!(r#"{} +pub const CLAP_LONG_VERSION:&str = shadow_rs::const_format::formatcp!(r#"{} tag:{} commit_hash:{} build_time:{}