diff options
author | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-07 23:10:27 +0400 |
---|---|---|
committer | Sam Truzjan <pxqr.sta@gmail.com> | 2013-12-07 23:10:27 +0400 |
commit | 1ae7d4877a2a30131babbee54bc0c24651eaba90 (patch) | |
tree | 1d2b6835d70a546859569933d0a34037b029d7c5 /src/Network/BitTorrent/Core/PeerAddr.hs | |
parent | 44fc77ee51b5aef9d43e3d384845d73646ea1d0e (diff) |
Move JSON options to separate module
Diffstat (limited to 'src/Network/BitTorrent/Core/PeerAddr.hs')
-rw-r--r-- | src/Network/BitTorrent/Core/PeerAddr.hs | 3 |
1 files changed, 2 insertions, 1 deletions
diff --git a/src/Network/BitTorrent/Core/PeerAddr.hs b/src/Network/BitTorrent/Core/PeerAddr.hs index 846a14f9..e7a4ea61 100644 --- a/src/Network/BitTorrent/Core/PeerAddr.hs +++ b/src/Network/BitTorrent/Core/PeerAddr.hs | |||
@@ -41,6 +41,7 @@ import Text.PrettyPrint.Class | |||
41 | import Text.Read (readMaybe) | 41 | import Text.Read (readMaybe) |
42 | import System.IO.Unsafe | 42 | import System.IO.Unsafe |
43 | 43 | ||
44 | import Data.Torrent.JSON | ||
44 | import Network.BitTorrent.Core.PeerId | 45 | import Network.BitTorrent.Core.PeerId |
45 | 46 | ||
46 | 47 | ||
@@ -68,7 +69,7 @@ data PeerAddr = PeerAddr | |||
68 | , peerPort :: {-# UNPACK #-} !PortNumber | 69 | , peerPort :: {-# UNPACK #-} !PortNumber |
69 | } deriving (Show, Eq, Ord, Typeable) | 70 | } deriving (Show, Eq, Ord, Typeable) |
70 | 71 | ||
71 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''PeerAddr) | 72 | $(deriveJSON omitRecordPrefix ''PeerAddr) |
72 | 73 | ||
73 | peer_id_key, peer_ip_key, peer_port_key :: BKey | 74 | peer_id_key, peer_ip_key, peer_port_key :: BKey |
74 | peer_id_key = "peer id" | 75 | peer_id_key = "peer id" |