diff options
Diffstat (limited to 'src/Data/Torrent.hs')
-rw-r--r-- | src/Data/Torrent.hs | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/src/Data/Torrent.hs b/src/Data/Torrent.hs index b3ac7586..ce919907 100644 --- a/src/Data/Torrent.hs +++ b/src/Data/Torrent.hs | |||
@@ -123,7 +123,7 @@ data InfoDict = InfoDict | |||
123 | -- BEP 27: <http://www.bittorrent.org/beps/bep_0027.html> | 123 | -- BEP 27: <http://www.bittorrent.org/beps/bep_0027.html> |
124 | } deriving (Show, Read, Eq, Typeable) | 124 | } deriving (Show, Read, Eq, Typeable) |
125 | 125 | ||
126 | $(deriveJSON (L.map Char.toLower . L.dropWhile isLower) ''InfoDict) | 126 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map Char.toLower . L.dropWhile isLower) } ''InfoDict) |
127 | 127 | ||
128 | makeLensesFor | 128 | makeLensesFor |
129 | [ ("idInfoHash" , "infohash" ) | 129 | [ ("idInfoHash" , "infohash" ) |
@@ -137,8 +137,8 @@ instance NFData InfoDict where | |||
137 | rnf InfoDict {..} = rnf idLayoutInfo | 137 | rnf InfoDict {..} = rnf idLayoutInfo |
138 | 138 | ||
139 | instance Hashable InfoDict where | 139 | instance Hashable InfoDict where |
140 | hash = Hashable.hash . idInfoHash | 140 | hashWithSalt = Hashable.hashUsing idInfoHash |
141 | {-# INLINE hash #-} | 141 | {-# INLINE hashWithSalt #-} |
142 | 142 | ||
143 | -- | Smart constructor: add a info hash to info dictionary. | 143 | -- | Smart constructor: add a info hash to info dictionary. |
144 | infoDictionary :: LayoutInfo -> PieceInfo -> Bool -> InfoDict | 144 | infoDictionary :: LayoutInfo -> PieceInfo -> Bool -> InfoDict |
@@ -239,7 +239,7 @@ instance ToJSON NominalDiffTime where | |||
239 | instance FromJSON NominalDiffTime where | 239 | instance FromJSON NominalDiffTime where |
240 | parseJSON v = utcTimeToPOSIXSeconds <$> parseJSON v | 240 | parseJSON v = utcTimeToPOSIXSeconds <$> parseJSON v |
241 | 241 | ||
242 | $(deriveJSON (L.map Char.toLower . L.dropWhile isLower) ''Torrent) | 242 | $(deriveJSON defaultOptions { fieldLabelModifier = (L.map Char.toLower . L.dropWhile isLower) } ''Torrent) |
243 | 243 | ||
244 | makeLensesFor | 244 | makeLensesFor |
245 | [ ("tAnnounce" , "announce" ) | 245 | [ ("tAnnounce" , "announce" ) |