From 8cb9381befed4174624edfc80e09185c9340b4f6 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Fri, 10 Mar 2017 13:12:24 -0400 Subject: AssociatedFile newtype To prevent any further mistakes like 1a497cefb47557f0b4788c606f9071be422b2511 This commit was sponsored by Francois Marier on Patreon. --- Limit/Wanted.hs | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) (limited to 'Limit') diff --git a/Limit/Wanted.hs b/Limit/Wanted.hs index c11e24b7d..a41398c10 100644 --- a/Limit/Wanted.hs +++ b/Limit/Wanted.hs @@ -13,12 +13,14 @@ import Limit import Types.FileMatcher addWantGet :: Annex () -addWantGet = addLimit $ Right $ const $ checkWant $ wantGet False Nothing +addWantGet = addLimit $ Right $ const $ checkWant $ + wantGet False Nothing addWantDrop :: Annex () -addWantDrop = addLimit $ Right $ const $ checkWant $ wantDrop False Nothing Nothing +addWantDrop = addLimit $ Right $ const $ checkWant $ + wantDrop False Nothing Nothing -checkWant :: (Maybe FilePath -> Annex Bool) -> MatchInfo -> Annex Bool -checkWant a (MatchingFile fi) = a (Just $ matchFile fi) +checkWant :: (AssociatedFile -> Annex Bool) -> MatchInfo -> Annex Bool +checkWant a (MatchingFile fi) = a (AssociatedFile (Just $ matchFile fi)) checkWant _ (MatchingKey _) = return False checkWant _ (MatchingInfo {}) = return False -- cgit v1.2.3