clean up build warnings when built w/o servant
This commit is contained in:
parent
ffba57c9fc
commit
7c6c3e703b
1 changed files with 3 additions and 2 deletions
|
@ -11,8 +11,8 @@ module P2P.Http.Url where
|
||||||
|
|
||||||
import Data.List
|
import Data.List
|
||||||
import Network.URI
|
import Network.URI
|
||||||
import System.FilePath.Posix as P
|
|
||||||
#ifdef WITH_SERVANT
|
#ifdef WITH_SERVANT
|
||||||
|
import System.FilePath.Posix as P
|
||||||
import Servant.Client (BaseUrl(..), Scheme(..))
|
import Servant.Client (BaseUrl(..), Scheme(..))
|
||||||
import Text.Read
|
import Text.Read
|
||||||
#endif
|
#endif
|
||||||
|
@ -37,13 +37,14 @@ parseP2PHttpUrl :: String -> Maybe P2PHttpUrl
|
||||||
parseP2PHttpUrl us
|
parseP2PHttpUrl us
|
||||||
| isP2PHttpProtocolUrl us = case parseURI (drop prefixlen us) of
|
| isP2PHttpProtocolUrl us = case parseURI (drop prefixlen us) of
|
||||||
Nothing -> Nothing
|
Nothing -> Nothing
|
||||||
Just u ->
|
|
||||||
#ifdef WITH_SERVANT
|
#ifdef WITH_SERVANT
|
||||||
|
Just u ->
|
||||||
case uriScheme u of
|
case uriScheme u of
|
||||||
"http:" -> mkbaseurl Http u
|
"http:" -> mkbaseurl Http u
|
||||||
"https:" -> mkbaseurl Https u
|
"https:" -> mkbaseurl Https u
|
||||||
_ -> Nothing
|
_ -> Nothing
|
||||||
#else
|
#else
|
||||||
|
Just _u ->
|
||||||
Just $ P2PHttpUrl us
|
Just $ P2PHttpUrl us
|
||||||
#endif
|
#endif
|
||||||
| otherwise = Nothing
|
| otherwise = Nothing
|
||||||
|
|
Loading…
Add table
Reference in a new issue