-
Notifications
You must be signed in to change notification settings - Fork 325
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
Merge pull request #2463 from wireapp/lint-libs
Lint libs folder (partial)
- Loading branch information
Showing
69 changed files
with
309 additions
and
334 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -1,5 +1,3 @@ | ||
{-# LANGUAGE LambdaCase #-} | ||
|
||
-- This file is part of the Wire Server implementation. | ||
-- | ||
-- Copyright (C) 2022 Wire Swiss GmbH <[email protected]> | ||
|
@@ -67,12 +65,12 @@ randomBytes :: MonadIO m => Box -> Word32 -> m ByteString | |
randomBytes b n = liftIO $ CBox.randomBytes b n >>= unwrap >>= CBox.copyBytes | ||
|
||
unwrap :: (Show a, MonadThrow m) => CBox.Result a -> m a | ||
unwrap (CBox.Success a) = return a | ||
unwrap (CBox.Success a) = pure a | ||
unwrap other = throwM $ userError (show other) | ||
|
||
getBoxDir :: UserId -> Maybe Text -> IO FilePath | ||
getBoxDir uid label = do | ||
tmp <- getTemporaryDirectory | ||
let usrDir = show (toUUID uid) | ||
let cltDir = maybe "" Text.unpack label | ||
return $ tmp </> "wire-bot" </> usrDir </> cltDir | ||
pure $ tmp </> "wire-bot" </> usrDir </> cltDir |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Oops, something went wrong.