From 84e26b3d0b4a3f3e55c18113fcb16464d2290085 Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Thu, 6 Feb 2020 22:47:47 -0600 Subject: [PATCH] refactor/polish ~ fix `cargo clippy` complaints (or_fun_call) --- src/factor/build.rs | 2 +- src/stdbuf/build.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/src/factor/build.rs b/src/factor/build.rs index ba9ac6f19..ba65c01ae 100644 --- a/src/factor/build.rs +++ b/src/factor/build.rs @@ -82,7 +82,7 @@ fn main() { let n = args() .skip(1) .next() - .unwrap_or("1027".to_string()) + .unwrap_or_else(|| "1027".to_string()) .parse::() .ok() .unwrap_or(1027); diff --git a/src/stdbuf/build.rs b/src/stdbuf/build.rs index 256592301..73189508b 100644 --- a/src/stdbuf/build.rs +++ b/src/stdbuf/build.rs @@ -30,7 +30,7 @@ fn main() { let libstdbuf = format!( "{}/../../{}/{}/deps/liblibstdbuf{}", manifest_dir, - env::var("CARGO_TARGET_DIR").unwrap_or("target".to_string()), + env::var("CARGO_TARGET_DIR").unwrap_or_else(|_| "target".to_string()), profile, platform::DYLIB_EXT );