1
Fork 0

Prefer unwrap_or_else to unwrap_or in case of function calls/allocations

This commit is contained in:
ljedrz 2018-10-12 16:16:00 +02:00
parent cb5e1b93e3
commit d28aed6dc4
35 changed files with 57 additions and 54 deletions

View file

@ -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 {