Use as_deref
in compiler (but only where it makes sense)
This commit is contained in:
parent
03e3cc5b77
commit
268219da02
@ -104,5 +104,5 @@ pub(crate) fn copy_dir_recursively(from: &Path, to: &Path) {
|
|||||||
}
|
}
|
||||||
|
|
||||||
pub(crate) fn is_ci() -> bool {
|
pub(crate) fn is_ci() -> bool {
|
||||||
env::var("CI").as_ref().map(|val| &**val) == Ok("true")
|
env::var("CI").as_deref() == Ok("true")
|
||||||
}
|
}
|
||||||
|
@ -2,7 +2,7 @@
|
|||||||
use std::str::FromStr;
|
use std::str::FromStr;
|
||||||
|
|
||||||
fn bool_env_var(key: &str) -> bool {
|
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.
|
/// The mode to use for compilation.
|
||||||
|
Loading…
Reference in New Issue
Block a user