1
Fork 0

use matches!() macro for simple if let conditions

This commit is contained in:
Matthias Krüger 2020-09-18 19:11:06 +02:00
parent 2c69266c06
commit 40dddd3305
15 changed files with 33 additions and 36 deletions

View file

@ -281,8 +281,7 @@ impl<'a, 'tcx> CfgSimplifier<'a, 'tcx> {
fn strip_nops(&mut self) {
for blk in self.basic_blocks.iter_mut() {
blk.statements
.retain(|stmt| if let StatementKind::Nop = stmt.kind { false } else { true })
blk.statements.retain(|stmt| !matches!(stmt.kind, StatementKind::Nop))
}
}
}