Get rid of loop

This commit is contained in:
Ayaz Hafiz 2022-07-21 18:20:11 -04:00
parent 5988257bde
commit 90acbd54ef
No known key found for this signature in database
GPG key ID: 0E2A37416A25EF58

View file

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