Skip to content

Commit

Permalink
hlint: Use pure instead of return
Browse files Browse the repository at this point in the history
  • Loading branch information
erikd committed Jun 11, 2021
1 parent 57daf09 commit 5714a73
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 2 deletions.
2 changes: 2 additions & 0 deletions .hlint.yaml
Expand Up @@ -43,6 +43,8 @@
# Will suggest replacing "wibbleMany [myvar]" with "wibbleOne myvar"
# - error: {lhs: "wibbleMany [x]", rhs: wibbleOne x}

- error: {lhs: "return x", rhs: pure x}


# Turn on hints that are off by default
#
Expand Down
4 changes: 2 additions & 2 deletions cardano-db-sync/src/Cardano/DbSync/Era/Shelley/Insert.hs
Expand Up @@ -662,13 +662,13 @@ insertTxMetadata tracer txId metadata =
Left err -> do
liftIO . logWarning tracer $ mconcat
[ "insertTxMetadata: Could not decode to UTF8: ", textShow err ]
return Nothing
pure Nothing
Right json ->
-- See https://github.com/input-output-hk/cardano-db-sync/issues/297
if containsUnicodeNul json
then do
liftIO $ logWarning tracer "insertTxMetadata: dropped due to a Unicode NUL character."
return Nothing
pure Nothing
else
pure $ Just json
void . lift . DB.insertTxMetadata $
Expand Down

0 comments on commit 5714a73

Please sign in to comment.