summaryrefslogtreecommitdiff
path: root/src/Network/BitTorrent/Tracker
diff options
context:
space:
mode:
authorSam Truzjan <pxqr.sta@gmail.com>2013-11-29 19:28:30 +0400
committerSam Truzjan <pxqr.sta@gmail.com>2013-11-29 19:28:30 +0400
commit8e9896c5d03ba2362e5068151106f756f0a002a1 (patch)
treecfb508c8b13b3442592c5af0e1163d00aca7ff49 /src/Network/BitTorrent/Tracker
parent10b16409b44e0f11db57e52d6ddd1f95a4eb7aec (diff)
Remove byteStringToPeerId to simplify API
Diffstat (limited to 'src/Network/BitTorrent/Tracker')
-rw-r--r--src/Network/BitTorrent/Tracker/Message.hs8
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Network/BitTorrent/Tracker/Message.hs b/src/Network/BitTorrent/Tracker/Message.hs
index 046f7e57..9999d128 100644
--- a/src/Network/BitTorrent/Tracker/Message.hs
+++ b/src/Network/BitTorrent/Tracker/Message.hs
@@ -267,7 +267,7 @@ instance FromParam InfoHash where
267 fromParam = either (const Nothing) pure . safeConvert 267 fromParam = either (const Nothing) pure . safeConvert
268 268
269instance FromParam PeerId where 269instance FromParam PeerId where
270 fromParam = byteStringToPeerId 270 fromParam = either (const Nothing) pure . safeConvert
271 271
272instance FromParam Word32 where 272instance FromParam Word32 where
273 fromParam = readMaybe . BC.unpack 273 fromParam = readMaybe . BC.unpack
@@ -282,9 +282,9 @@ instance FromParam PortNumber where
282 fromParam bs = fromIntegral <$> (fromParam bs :: Maybe Word32) 282 fromParam bs = fromIntegral <$> (fromParam bs :: Maybe Word32)
283 283
284instance FromParam Event where 284instance FromParam Event where
285 fromParam bs = case BC.uncons bs of 285 fromParam bs = do
286 Nothing -> Nothing 286 (x, xs) <- BC.uncons bs
287 Just (x, xs) -> readMaybe $ BC.unpack $ BC.cons (Char.toUpper x) xs 287 readMaybe $ BC.unpack $ BC.cons (Char.toUpper x) xs
288 288
289type Result = Either ParamParseFailure 289type Result = Either ParamParseFailure
290 290