mirror of
https://github.com/jfmengels/elm-review.git
synced 2024-08-16 19:40:22 +03:00
Use a let expression
This commit is contained in:
parent
75650d1952
commit
776cb6f293
@ -469,6 +469,9 @@ reportError knownClasses range name =
|
||||
|
||||
similarClasses : String -> Set String -> List String
|
||||
similarClasses targetClass knownClasses =
|
||||
let
|
||||
classes : { first : Maybe { class : String, distance : Int }, second : Maybe { class : String, distance : Int } }
|
||||
classes =
|
||||
Set.foldl
|
||||
(\class ({ first, second } as untouched) ->
|
||||
let
|
||||
@ -491,7 +494,8 @@ similarClasses targetClass knownClasses =
|
||||
)
|
||||
{ first = Nothing, second = Nothing }
|
||||
knownClasses
|
||||
|> (\{ first, second } -> List.filterMap (Maybe.map .class) [ first, second ])
|
||||
in
|
||||
List.filterMap (Maybe.map .class) [ classes.first, classes.second ]
|
||||
|
||||
|
||||
isSmallerDistance : Int -> Maybe { a | distance : Int } -> Bool
|
||||
|
Loading…
Reference in New Issue
Block a user