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
|
@ -1971,7 +1971,7 @@ impl<'a, 'tcx> LifetimeContext<'a, 'tcx> {
|
|||
// Therefore, we would compute `object_lifetime_defaults` to a
|
||||
// vector like `['x, 'static]`. Note that the vector only
|
||||
// includes type parameters.
|
||||
let object_lifetime_defaults = type_def_id.map_or(vec![], |def_id| {
|
||||
let object_lifetime_defaults = type_def_id.map_or_else(Vec::new, |def_id| {
|
||||
let in_body = {
|
||||
let mut scope = self.scope;
|
||||
loop {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue