1
Fork 0

Rollup merge of #85973 - LingMan:indentation, r=jyn514

Replace a `match` with an `if let`

Seems like a better fit here and saves one level of indentation.

`@rustbot` modify labels +C-cleanup +T-compiler
This commit is contained in:
Yuki Okushi 2021-06-07 15:21:01 +09:00 committed by GitHub
commit 7fcfe05680
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23

View file

@ -16,8 +16,7 @@ impl<'tcx> MirPass<'tcx> for RemoveZsts {
let (basic_blocks, local_decls) = body.basic_blocks_and_local_decls_mut();
for block in basic_blocks.iter_mut() {
for statement in block.statements.iter_mut() {
match statement.kind {
StatementKind::Assign(box (place, _)) => {
if let StatementKind::Assign(box (place, _)) = statement.kind {
let place_ty = place.ty(local_decls, tcx).ty;
if !maybe_zst(place_ty) {
continue;
@ -41,8 +40,6 @@ impl<'tcx> MirPass<'tcx> for RemoveZsts {
statement.make_nop();
}
}
_ => {}
}
}
}
}