diff options
Diffstat (limited to 'src/Data/Torrent.hs')
-rw-r--r-- | src/Data/Torrent.hs | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/Data/Torrent.hs b/src/Data/Torrent.hs index d6227b6f..b3ac7586 100644 --- a/src/Data/Torrent.hs +++ b/src/Data/Torrent.hs | |||
@@ -78,10 +78,10 @@ import Data.ByteString as BS | |||
78 | import qualified Data.ByteString.Char8 as BC (pack, unpack) | 78 | import qualified Data.ByteString.Char8 as BC (pack, unpack) |
79 | import qualified Data.ByteString.Lazy as BL | 79 | import qualified Data.ByteString.Lazy as BL |
80 | import Data.Char as Char | 80 | import Data.Char as Char |
81 | import Data.Convertible | ||
81 | import Data.Default | 82 | import Data.Default |
82 | import Data.Hashable as Hashable | 83 | import Data.Hashable as Hashable |
83 | import qualified Data.List as L | 84 | import qualified Data.List as L |
84 | import Data.Maybe | ||
85 | import Data.Text as T | 85 | import Data.Text as T |
86 | import Data.Time | 86 | import Data.Time |
87 | import Data.Time.Clock.POSIX | 87 | import Data.Time.Clock.POSIX |
@@ -155,7 +155,7 @@ putPrivate True = \ cont -> "private" .=! True .: cont | |||
155 | 155 | ||
156 | -- | Hash lazy bytestring using SHA1 algorithm. | 156 | -- | Hash lazy bytestring using SHA1 algorithm. |
157 | hashLazyIH :: BL.ByteString -> InfoHash | 157 | hashLazyIH :: BL.ByteString -> InfoHash |
158 | hashLazyIH = fromMaybe (error msg) . byteStringToInfoHash . C.hashlazy | 158 | hashLazyIH = either (const (error msg)) id . safeConvert . C.hashlazy |
159 | where | 159 | where |
160 | msg = "Infohash.hash: impossible: SHA1 is always 20 bytes long" | 160 | msg = "Infohash.hash: impossible: SHA1 is always 20 bytes long" |
161 | 161 | ||