From 98537ce8b7641c59a57ed375cc24858f23340aff Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?Rust=E5=A4=A7=E9=97=B8=E8=9F=B9?= Date: Mon, 28 Dec 2020 03:00:14 +0800 Subject: [PATCH] remove code not used. Fix use shadow-rs build warning (#2827) * update to shadow-rs 0.4. use easy * update shadow-rs to 0.5 * fix version not used * update * update Cargo.lock * update Cargo.lock * fix wasm build error when use dependence git2 fix error link:https://dev.azure.com/nushell/nushell/_build/results?buildId=4858&view=logs&j=1a745d4c-b027-5f34-06d8-d6f256bfe9f9&t=a0a335cb-fa1f-5bbf-be01-1a90d6899e54 * remove code not used; fix warning by RUSTFLAGS="-D warnings" build error * upgrade shadow-rs 0.5.2 --- Cargo.lock | 4 +-- crates/nu-cli/src/commands/version.rs | 38 --------------------------- 2 files changed, 2 insertions(+), 40 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 9b369e0542..b536a82b53 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -5183,9 +5183,9 @@ dependencies = [ [[package]] name = "shadow-rs" -version = "0.5.1" +version = "0.5.2" source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "b5ee6ecc8237a62951c2e5c871aa86799ba8a9bf909b5567129858039ae63e87" +checksum = "04e282c2db7b215c4b002b557dd253ca5bac87e9509cc585deca849a93d88435" dependencies = [ "chrono", "git2", diff --git a/crates/nu-cli/src/commands/version.rs b/crates/nu-cli/src/commands/version.rs index e015db5d87..650b19ae68 100644 --- a/crates/nu-cli/src/commands/version.rs +++ b/crates/nu-cli/src/commands/version.rs @@ -77,24 +77,6 @@ pub fn version(args: CommandArgs) -> Result { ); } - // let commit_author: Option<&str> = Some(shadow::COMMIT_AUTHOR).filter(|x| !x.is_empty()); - // if let Some(commit_author) = commit_author { - // indexmap.insert( - // "commit_author".to_string(), - // commit_author.to_pattern_untagged_value().into_value(&tag), - // ); - // } - let _commit_autor = shadow::COMMIT_AUTHOR; - - // let commit_email: Option<&str> = Some(shadow::COMMIT_EMAIL).filter(|x| !x.is_empty()); - // if let Some(commit_email) = commit_email { - // indexmap.insert( - // "commit_email".to_string(), - // commit_email.to_pattern_untagged_value().into_value(&tag), - // ); - // } - let _commit_email = shadow::COMMIT_EMAIL; - let build_os: Option<&str> = Some(shadow::BUILD_OS).filter(|x| !x.is_empty()); if let Some(build_os) = build_os { indexmap.insert( @@ -135,26 +117,6 @@ pub fn version(args: CommandArgs) -> Result { ); } - // let cargo_tree: Option<&str> = Some(shadow::CARGO_TREE).filter(|x| !x.is_empty()); - // if let Some(cargo_tree) = cargo_tree { - // indexmap.insert( - // "cargo_tree".to_string(), - // cargo_tree.to_pattern_untagged_value().into_value(&tag), - // ); - // } - let _cargo_tree = shadow::CARGO_TREE; - - // let project_name: Option<&str> = Some(shadow::PROJECT_NAME).filter(|x| !x.is_empty()); - // if let Some(project_name) = project_name { - // indexmap.insert( - // "project_name".to_string(), - // project_name.to_pattern_untagged_value().into_value(&tag), - // ); - // } - let _project_name = shadow::PROJECT_NAME; - - let _version = shadow::version(); - let build_time: Option<&str> = Some(shadow::BUILD_TIME).filter(|x| !x.is_empty()); if let Some(build_time) = build_time { indexmap.insert(