]> dgit.raspbian.org Git - git-annex.git/commitdiff
clean up build warnings when built w/o servant
authorJoey Hess <joeyh@joeyh.name>
Wed, 31 Jul 2024 18:07:30 +0000 (14:07 -0400)
committerJoey Hess <joeyh@joeyh.name>
Wed, 31 Jul 2024 18:07:30 +0000 (14:07 -0400)
P2P/Http/Url.hs

index 09a8e56f9af845e6a385a54ee2aaaf47b85839c1..9e1af2c8dcfbec5359782c4fe1fb35c5563c2e22 100644 (file)
@@ -11,8 +11,8 @@ module P2P.Http.Url where
 
 import Data.List
 import Network.URI
-import System.FilePath.Posix as P
 #ifdef WITH_SERVANT
+import System.FilePath.Posix as P
 import Servant.Client (BaseUrl(..), Scheme(..))
 import Text.Read
 #endif
@@ -37,13 +37,14 @@ parseP2PHttpUrl :: String -> Maybe P2PHttpUrl
 parseP2PHttpUrl us
        | isP2PHttpProtocolUrl us = case parseURI (drop prefixlen us) of
                Nothing -> Nothing
-               Just u ->
 #ifdef WITH_SERVANT
+               Just u ->
                        case uriScheme u of
                                "http:" -> mkbaseurl Http u
                                "https:" -> mkbaseurl Https u
                                _ -> Nothing
 #else
+               Just _u ->
                        Just $ P2PHttpUrl us
 #endif
        | otherwise = Nothing