Auto merge of #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")
This commit is contained in:
commit
872631d0f0
27 changed files with 45 additions and 63 deletions
|
@ -2,7 +2,7 @@ use std::env;
|
|||
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.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue