Use as_deref in compiler (but only where it makes sense)

This commit is contained in:
Maybe Waffle 2022-11-16 21:58:58 +00:00
parent 03e3cc5b77
commit 268219da02
2 changed files with 2 additions and 2 deletions

View File

@ -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")
}

View File

@ -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.