mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-26 13:29:12 +00:00
Get rid of loop
This commit is contained in:
parent
5d2cfa1482
commit
a56e4a37c3
1 changed files with 12 additions and 14 deletions
|
@ -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,
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue