You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
casedo:something() of
{ok, Result} -> do:something(else)
end
…should actually be written using pattern-matching:
{ok, Result} =do:something(),
do:something(else)
The case statement is unnecessary and the only difference between the two is that the exception raised in the case of error changes from case_clause to badmatch.
Should be on by default?
YES
Options
None.
Reasoning
Paraphrasing Elm-Review documentation:
[…] single-pattern case expressions […] may be written more concisely or removed entirely.
No Single Clause Case Statements
Brief Description
The following code…
…should actually be written using pattern-matching:
The
case
statement is unnecessary and the only difference between the two is that the exception raised in the case of error changes fromcase_clause
tobadmatch
.Should be on by default?
YES
Options
Reasoning
Paraphrasing Elm-Review documentation:
Origin (#281)
Inspired by the
NoSinglePatternCase
rule from elm-reviewThe text was updated successfully, but these errors were encountered: