avoid unneccessary Maybe

This commit is contained in:
Joey Hess 2018-07-16 12:06:06 -04:00
parent d529e18460
commit d3f06ad112
No known key found for this signature in database
GPG key ID: DB12DB0FF05F8F38

View file

@ -26,9 +26,9 @@ import Network.Socket
defaultUserAgent :: U.UserAgent
defaultUserAgent = "git-annex/" ++ BuildInfo.packageversion
getUserAgent :: Annex (Maybe U.UserAgent)
getUserAgent :: Annex U.UserAgent
getUserAgent = Annex.getState $
Just . fromMaybe defaultUserAgent . Annex.useragent
fromMaybe defaultUserAgent . Annex.useragent
getUrlOptions :: Annex U.UrlOptions
getUrlOptions = Annex.getState Annex.urloptions >>= \case
@ -42,7 +42,7 @@ getUrlOptions = Annex.getState Annex.urloptions >>= \case
mk = do
(urldownloader, manager) <- checkallowedaddr
mkUrlOptions
<$> getUserAgent
<$> (Just <$> getUserAgent)
<*> headers
<*> pure urldownloader
<*> pure manager