mirror of
https://github.com/roc-lang/roc.git
synced 2025-09-27 13:59:08 +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,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,
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue