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
|
@ -50,7 +50,7 @@ fn eval_body_using_ecx<'mir, 'tcx>(
|
|||
|
||||
let name =
|
||||
with_no_trimmed_paths(|| ty::tls::with(|tcx| tcx.def_path_str(cid.instance.def_id())));
|
||||
let prom = cid.promoted.map_or(String::new(), |p| format!("::promoted[{:?}]", p));
|
||||
let prom = cid.promoted.map_or_else(String::new, |p| format!("::promoted[{:?}]", p));
|
||||
trace!("eval_body_using_ecx: pushing stack frame for global: {}{}", name, prom);
|
||||
|
||||
ecx.push_stack_frame(
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue