summaryrefslogtreecommitdiff
path: root/Remote/Helper/Encryptable.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2011-10-11 14:43:45 -0400
committerGravatar Joey Hess <joey@kitenet.net>2011-10-11 14:43:45 -0400
commitb505ba83e8b62a9ed0ec2fb96448c5fc801184d9 (patch)
tree664eb4af9f274dfc13eb9abfab86421ebe38e881 /Remote/Helper/Encryptable.hs
parent025ded4a2dfb58a6ec0cb47b9d625d593a4e1977 (diff)
minor syntax changes
Diffstat (limited to 'Remote/Helper/Encryptable.hs')
-rw-r--r--Remote/Helper/Encryptable.hs6
1 files changed, 2 insertions, 4 deletions
diff --git a/Remote/Helper/Encryptable.hs b/Remote/Helper/Encryptable.hs
index 004b70408..85d269a21 100644
--- a/Remote/Helper/Encryptable.hs
+++ b/Remote/Helper/Encryptable.hs
@@ -78,8 +78,6 @@ remoteCipher c = maybe expensive cached =<< Annex.getState Annex.cipher
{- Gets encryption Cipher, and encrypted version of Key. -}
cipherKey :: Maybe RemoteConfig -> Key -> Annex (Maybe (Cipher, Key))
cipherKey Nothing _ = return Nothing
-cipherKey (Just c) k = remoteCipher c >>= maybe (return Nothing) encrypt
+cipherKey (Just c) k = maybe Nothing encrypt <$> remoteCipher c
where
- encrypt ciphertext = do
- k' <- liftIO $ encryptKey ciphertext k
- return $ Just (ciphertext, k')
+ encrypt ciphertext = Just (ciphertext, encryptKey ciphertext k)