From 1ae7d4877a2a30131babbee54bc0c24651eaba90 Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Sat, 7 Dec 2013 23:10:27 +0400 Subject: Move JSON options to separate module --- src/Network/BitTorrent/Core/PeerAddr.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'src/Network/BitTorrent/Core/PeerAddr.hs') 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 import Text.Read (readMaybe) import System.IO.Unsafe +import Data.Torrent.JSON import Network.BitTorrent.Core.PeerId @@ -68,7 +69,7 @@ data PeerAddr = PeerAddr , peerPort :: {-# UNPACK #-} !PortNumber } deriving (Show, Eq, Ord, Typeable) -$(deriveJSON defaultOptions { fieldLabelModifier = (L.map toLower . L.dropWhile isLower) } ''PeerAddr) +$(deriveJSON omitRecordPrefix ''PeerAddr) peer_id_key, peer_ip_key, peer_port_key :: BKey peer_id_key = "peer id" -- cgit v1.2.3