mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 05:49:08 +00:00
Get rid of loop
This commit is contained in:
parent
5988257bde
commit
90acbd54ef
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 {
|
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,
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue