cln: hlint: Fix redundant return warning.

This commit is contained in:
Stephen Morgan 2021-08-16 16:54:58 +10:00 committed by Simon Michael
parent 8bf7cd30ae
commit 1c211f8ab8
6 changed files with 3 additions and 9 deletions

View File

@ -50,7 +50,6 @@
- ignore: {name: "Redundant bang pattern"}
- ignore: {name: "Use zipWith"}
- ignore: {name: "Replace case with maybe"}
- ignore: {name: "Redundant return"}
- ignore: {name: "Avoid lambda using `infix`"}
- ignore: {name: "Use <|>"}
- ignore: {name: "Use zip"}

View File

@ -986,7 +986,6 @@ lotpricep = label "ledger-style lot price" $ do
lift skipNonNewlineSpaces
char '}'
when (doublebrace) $ void $ char '}'
return ()
-- Parse a Ledger-style lot date [DATE], and ignore it.
-- https://www.ledger-cli.org/3.0/doc/ledger3.html#Fixing-Lot-Prices .

View File

@ -1266,8 +1266,7 @@ csvFieldValue :: CsvRules -> CsvRecord -> CsvFieldName -> Maybe Text
csvFieldValue rules record fieldname = do
fieldindex <- if | T.all isDigit fieldname -> readMay $ T.unpack fieldname
| otherwise -> lookup (T.toLower fieldname) $ rcsvfieldindexes rules
fieldvalue <- T.strip <$> atMay record (fieldindex-1)
return fieldvalue
T.strip <$> atMay record (fieldindex-1)
-- | Parse the date string using the specified date-format, or if unspecified
-- the "simple date" formats (YYYY/MM/DD, YYYY-MM-DD, YYYY.MM.DD, leading

View File

@ -134,9 +134,8 @@ words' :: String -> [String]
words' "" = []
words' s = map stripquotes $ fromparse $ parsewithString p s
where
p = do ss <- (singleQuotedPattern <|> doubleQuotedPattern <|> patterns) `sepBy` skipNonNewlineSpaces1
-- eof
return ss
p = (singleQuotedPattern <|> doubleQuotedPattern <|> patterns) `sepBy` skipNonNewlineSpaces1
-- eof
patterns = many (noneOf whitespacechars)
singleQuotedPattern = between (char '\'') (char '\'') (many $ noneOf "'")
doubleQuotedPattern = between (char '"') (char '"') (many $ noneOf "\"")

View File

@ -35,7 +35,6 @@ main = do
let rates = [0.70, 0.71 .. 1.3]
mapM_ (\(n,d,(a,b),c,p) -> putStr $ showtxn n d a b c p) $ take numtxns $ zip5 [1..] dates accts comms (drop 1 comms)
mapM_ (\(d,rate) -> putStr $ showmarketprice d rate) $ take numtxns $ zip dates (cycle $ rates ++ init (tail (reverse rates)))
return ()
showtxn :: Int -> Day -> String -> String -> Char -> Char -> String
showtxn txnno date acct1 acct2 comm pricecomm =

View File

@ -20,7 +20,6 @@ main = do
today <- getCurrentDay
let startdate = addDays (-numentries) today
mapM_ (putStr . showentry) [startdate..today]
return ()
showentry d =
printf "i %s 09:00:00 dummy\no %s 17:00:00\n" (show d) (show d)