From ff7180cc35dd7043f1d193428ac425ccad53f37a Mon Sep 17 00:00:00 2001 From: honeywest Date: Sat, 9 Jan 2021 15:24:12 +0800 Subject: [PATCH] feat unwrap_or warning --- src/util.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/src/util.rs b/src/util.rs index f8deaa40..2c47060c 100644 --- a/src/util.rs +++ b/src/util.rs @@ -50,7 +50,7 @@ where S: AsRef, P: AsRef, { - let cargo = std::env::var("CARGO").unwrap_or("cargo".to_string()); + let cargo = std::env::var("CARGO").unwrap_or_else(|_| "cargo".to_string()); let mut cmd = Command::new(cargo); if let Some(path) = working_dir { log::debug!("Setting cargo working dir to '{}'", path.as_ref().display()); -- GitLab