diff options
author | 2011-05-15 02:49:43 -0400 | |
---|---|---|
committer | 2011-05-15 03:38:08 -0400 | |
commit | cad0e1c8b7eb21f8dceca8dd9fa3bc1d1aa7eabd (patch) | |
tree | b6be12dc1cc83a35ca7d89a862d85e6d71c38572 /Crypto.hs | |
parent | efa7f544050c0d5be6bc1b0fc0125278e475c213 (diff) |
simplified a bunch of Maybe handling
Diffstat (limited to 'Crypto.hs')
-rw-r--r-- | Crypto.hs | 6 |
1 files changed, 2 insertions, 4 deletions
@@ -238,10 +238,8 @@ configKeyIds c = do keyIdField s = (split ":" s) !! 4 configGet :: RemoteConfig -> String -> String -configGet c key = - case M.lookup key c of - Just v -> v - Nothing -> error $ "missing " ++ key ++ " in remote config" +configGet c key = maybe missing id $ M.lookup key c + where missing = error $ "missing " ++ key ++ " in remote config" hmacWithCipher :: Cipher -> String -> String hmacWithCipher c = hmacWithCipher' (cipherHmac c) |