From 268219da020114913e101642e47699149778bbd8 Mon Sep 17 00:00:00 2001 From: Maybe Waffle Date: Wed, 16 Nov 2022 21:58:58 +0000 Subject: [PATCH] Use `as_deref` in compiler (but only where it makes sense) --- build_system/utils.rs | 2 +- src/config.rs | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/build_system/utils.rs b/build_system/utils.rs index 48da64906e2..c627af4e62f 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 e59a0cb0a23..45522fb1a4c 100644 --- a/src/config.rs +++ b/src/config.rs @@ -2,7 +2,7 @@ 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.