Get rid of loop

This commit is contained in:
Ayaz Hafiz 2022-07-21 18:20:11 -04:00 committed by Folkert
parent 5d2cfa1482
commit a56e4a37c3
No known key found for this signature in database
GPG key ID: 1F17F6FFD112B97C

View file

@ -988,21 +988,19 @@ fn is_irrelevant_to<'a>(selected_path: &[PathInstruction], branch: &Branch<'a>)
fn needs_tests(pattern: &Pattern) -> bool { fn needs_tests(pattern: &Pattern) -> bool {
use Pattern::*; use Pattern::*;
loop { match pattern {
match pattern { Identifier(_) | Underscore => false,
Identifier(_) | Underscore => return false,
NewtypeDestructure { .. } NewtypeDestructure { .. }
| RecordDestructure(..) | RecordDestructure(..)
| AppliedTag { .. } | AppliedTag { .. }
| OpaqueUnwrap { .. } | OpaqueUnwrap { .. }
| BitLiteral { .. } | BitLiteral { .. }
| EnumLiteral { .. } | EnumLiteral { .. }
| IntLiteral(_, _) | IntLiteral(_, _)
| FloatLiteral(_, _) | FloatLiteral(_, _)
| DecimalLiteral(_) | DecimalLiteral(_)
| StrLiteral(_) => return true, | StrLiteral(_) => true,
}
} }
} }