Changed unwrap_or to unwrap_or_else in some places.
The discussion seems to have resolved that this lint is a bit "noisy" in that applying it in all places would result in a reduction in readability. A few of the trivial functions (like `Path::new`) are fine to leave outside of closures. The general rule seems to be that anything that is obviously an allocation (`Box`, `Vec`, `vec![]`) should be in a closure, even if it is a 0-sized allocation.
This commit is contained in:
parent
65ae469f8d
commit
a5ec85758b
@ -27,8 +27,8 @@ impl rustc_driver::Callbacks for CraneliftPassesCallbacks {
|
||||
config.opts.cg.panic = Some(PanicStrategy::Abort);
|
||||
config.opts.debugging_opts.panic_abort_tests = true;
|
||||
config.opts.maybe_sysroot = Some(
|
||||
config.opts.maybe_sysroot.clone().unwrap_or(
|
||||
std::env::current_exe()
|
||||
config.opts.maybe_sysroot.clone().unwrap_or_else(
|
||||
|| std::env::current_exe()
|
||||
.unwrap()
|
||||
.parent()
|
||||
.unwrap()
|
||||
|
Loading…
Reference in New Issue
Block a user