Prefer unwrap_or_else to unwrap_or in case of function calls/allocations
This commit is contained in:
parent
cb5e1b93e3
commit
d28aed6dc4
35 changed files with 57 additions and 54 deletions
|
@ -482,7 +482,7 @@ impl<'b, 'tcx> ElaborateDropsCtxt<'b, 'tcx> {
|
|||
source_info: terminator.source_info
|
||||
};
|
||||
|
||||
let unwind = unwind.unwrap_or(self.patch.resume_block());
|
||||
let unwind = unwind.unwrap_or_else(|| self.patch.resume_block());
|
||||
let unwind = self.patch.new_block(BasicBlockData {
|
||||
statements: vec![assign.clone()],
|
||||
terminator: Some(Terminator {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue