Skip to content

Commit 982798f

Browse files
committed
Auto merge of rust-lang#104507 - WaffleLapkin:asderefsyou, r=wesleywiser
Use `as_deref` in compiler (but only where it makes sense) This simplifies some code :3 (there are some changes that are not exacly `as_deref`, but more like "clever `Option`/`Result` method use")
2 parents d3817e2 + 268219d commit 982798f

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)