cln: hlint: Remove if warnings.

This commit is contained in:
Stephen Morgan 2021-08-16 15:41:14 +10:00 committed by Simon Michael
parent d2beb89eba
commit 1e69fd81ea
2 changed files with 6 additions and 7 deletions

View File

@ -63,7 +63,6 @@
- ignore: {name: "Redundant flip"}
- ignore: {name: "Use replicate"}
- ignore: {name: "Use void"}
- ignore: {name: "Use if"}
- ignore: {name: "Use bimap"}
- ignore: {name: "Use newtype instead of data"}
- ignore: {name: "Use elemIndex"}

View File

@ -206,9 +206,9 @@ fitText mminwidth mmaxwidth ellipsify rightside = clip . pad
case mmaxwidth of
Just w
| textWidth s > w ->
case rightside of
True -> textTakeWidth (w - T.length ellipsis) s <> ellipsis
False -> ellipsis <> T.reverse (textTakeWidth (w - T.length ellipsis) $ T.reverse s)
if rightside
then textTakeWidth (w - T.length ellipsis) s <> ellipsis
else ellipsis <> T.reverse (textTakeWidth (w - T.length ellipsis) $ T.reverse s)
| otherwise -> s
where
ellipsis = if ellipsify then ".." else ""
@ -218,9 +218,9 @@ fitText mminwidth mmaxwidth ellipsify rightside = clip . pad
case mminwidth of
Just w
| sw < w ->
case rightside of
True -> s <> T.replicate (w - sw) " "
False -> T.replicate (w - sw) " " <> s
if rightside
then s <> T.replicate (w - sw) " "
else T.replicate (w - sw) " " <> s
| otherwise -> s
Nothing -> s
where sw = textWidth s