Skip to content

Commit 268219d

Browse files
committed
Use as_deref in compiler (but only where it makes sense)
1 parent 03e3cc5 commit 268219d

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

build_system/utils.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -104,5 +104,5 @@ pub(crate) fn copy_dir_recursively(from: &Path, to: &Path) {
104104
}
105105

106106
pub(crate) fn is_ci() -> bool {
107-
env::var("CI").as_ref().map(|val| &**val) == Ok("true")
107+
env::var("CI").as_deref() == Ok("true")
108108
}

src/config.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use std::env;
22
use std::str::FromStr;
33

44
fn bool_env_var(key: &str) -> bool {
5-
env::var(key).as_ref().map(|val| &**val) == Ok("1")
5+
env::var(key).as_deref() == Ok("1")
66
}
77

88
/// The mode to use for compilation.

0 commit comments

Comments
 (0)