summaryrefslogtreecommitdiff
path: root/Remote/Helper/Encryptable.hs
diff options
context:
space:
mode:
authorGravatar Joey Hess <joey@kitenet.net>2012-11-30 00:55:59 -0400
committerGravatar Joey Hess <joey@kitenet.net>2012-11-30 00:55:59 -0400
commit3026baf7ba4941029f3fb50888b3fd3290f720d1 (patch)
treedf34479c82189dde4d65453ee08a8195fb1bca59 /Remote/Helper/Encryptable.hs
parentdf31307f2ce1b037b68f16f9cb0187cf1e3a7b6d (diff)
avoid unnecessary Maybe
Diffstat (limited to 'Remote/Helper/Encryptable.hs')
-rw-r--r--Remote/Helper/Encryptable.hs7
1 files changed, 3 insertions, 4 deletions
diff --git a/Remote/Helper/Encryptable.hs b/Remote/Helper/Encryptable.hs
index 05aca9a41..d322a5cf8 100644
--- a/Remote/Helper/Encryptable.hs
+++ b/Remote/Helper/Encryptable.hs
@@ -44,7 +44,7 @@ encryptionSetup c = case (M.lookup "encryption" c, extractCipher c) of
- Two additional functions must be provided by the remote,
- to support storing and retrieving encrypted content. -}
encryptableRemote
- :: Maybe RemoteConfig
+ :: RemoteConfig
-> ((Cipher, Key) -> Key -> MeterUpdate -> Annex Bool)
-> ((Cipher, Key) -> Key -> FilePath -> Annex Bool)
-> Remote
@@ -103,9 +103,8 @@ embedCreds c
| otherwise = False
{- Gets encryption Cipher, and encrypted version of Key. -}
-cipherKey :: Maybe RemoteConfig -> Key -> Annex (Maybe (Cipher, Key))
-cipherKey Nothing _ = return Nothing
-cipherKey (Just c) k = maybe Nothing make <$> remoteCipher c
+cipherKey :: RemoteConfig -> Key -> Annex (Maybe (Cipher, Key))
+cipherKey c k = maybe Nothing make <$> remoteCipher c
where
make ciphertext = Just (ciphertext, encryptKey ciphertext k)