From 01c701b5a5c18cfa952394ae1cbd2249cfd08f51 Mon Sep 17 00:00:00 2001 From: Joey Hess Date: Wed, 3 Feb 2016 13:23:34 -0400 Subject: simplify --- Limit.hs | 11 ++++------- 1 file changed, 4 insertions(+), 7 deletions(-) (limited to 'Limit.hs') diff --git a/Limit.hs b/Limit.hs index b8053e6de..81b6d7564 100644 --- a/Limit.hs +++ b/Limit.hs @@ -118,11 +118,8 @@ addIn s = addLimit =<< mk else inAnnex key {- Limit to content that is currently present on a uuid. -} -limitPresent :: Maybe UUID -> MkLimit Annex -limitPresent u _ = Right $ matchPresent u - -matchPresent :: Maybe UUID -> MatchFiles Annex -matchPresent u _ = checkKey $ \key -> do +limitPresent :: Maybe UUID -> MatchFiles Annex +limitPresent u _ = checkKey $ \key -> do hereu <- getUUID if u == Just hereu || isNothing u then inAnnex key @@ -131,8 +128,8 @@ matchPresent u _ = checkKey $ \key -> do return $ maybe False (`elem` us) u {- Limit to content that is in a directory, anywhere in the repository tree -} -limitInDir :: FilePath -> MkLimit Annex -limitInDir dir = const $ Right $ const go +limitInDir :: FilePath -> MatchFiles Annex +limitInDir dir = const go where go (MatchingFile fi) = checkf $ matchFile fi go (MatchingKey _) = return False -- cgit v1.2.3