diff --git a/build_system/utils.rs b/build_system/utils.rs index 48da64906e2a..c627af4e62fe 100644 --- a/build_system/utils.rs +++ b/build_system/utils.rs @@ -104,5 +104,5 @@ pub(crate) fn copy_dir_recursively(from: &Path, to: &Path) { } pub(crate) fn is_ci() -> bool { - env::var("CI").as_ref().map(|val| &**val) == Ok("true") + env::var("CI").as_deref() == Ok("true") } diff --git a/src/config.rs b/src/config.rs index e59a0cb0a232..45522fb1a4ca 100644 --- a/src/config.rs +++ b/src/config.rs @@ -2,7 +2,7 @@ use std::env; use std::str::FromStr; fn bool_env_var(key: &str) -> bool { - env::var(key).as_ref().map(|val| &**val) == Ok("1") + env::var(key).as_deref() == Ok("1") } /// The mode to use for compilation.