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,9 +988,8 @@ 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 => return false, Identifier(_) | Underscore => false,
NewtypeDestructure { .. } NewtypeDestructure { .. }
| RecordDestructure(..) | RecordDestructure(..)
@ -1001,8 +1000,7 @@ fn needs_tests(pattern: &Pattern) -> bool {
| IntLiteral(_, _) | IntLiteral(_, _)
| FloatLiteral(_, _) | FloatLiteral(_, _)
| DecimalLiteral(_) | DecimalLiteral(_)
| StrLiteral(_) => return true, | StrLiteral(_) => true,
}
} }
} }