Rollup merge of #82456 - klensy:or-else, r=estebank
Replaced some unwrap_or and map_or with lazy variants Replaced some `unwrap_or` and `map_or` with `unwrap_or_else` and `map_or_else`.
This commit is contained in:
commit
039b1b62ac
17 changed files with 34 additions and 28 deletions
|
@ -169,7 +169,7 @@ pub fn get_or_default_sysroot() -> PathBuf {
|
|||
|
||||
// Check if sysroot is found using env::args().next(), and if is not found,
|
||||
// use env::current_exe() to imply sysroot.
|
||||
from_env_args_next().unwrap_or(from_current_exe())
|
||||
from_env_args_next().unwrap_or_else(from_current_exe)
|
||||
}
|
||||
|
||||
// The name of the directory rustc expects libraries to be located.
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue