From e2edd7436a287160d993815e2dc1ad9792435b9c Mon Sep 17 00:00:00 2001 From: Sam Truzjan Date: Thu, 28 Nov 2013 15:24:48 +0400 Subject: Remove byteStringToInfoHash function --- tests/Data/Torrent/InfoHashSpec.hs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) (limited to 'tests/Data') diff --git a/tests/Data/Torrent/InfoHashSpec.hs b/tests/Data/Torrent/InfoHashSpec.hs index afa017ef..3cc110c1 100644 --- a/tests/Data/Torrent/InfoHashSpec.hs +++ b/tests/Data/Torrent/InfoHashSpec.hs @@ -3,6 +3,7 @@ module Data.Torrent.InfoHashSpec (spec) where import Control.Applicative import Data.ByteString as BS +import Data.Convertible import Data.Maybe import System.FilePath import Test.Hspec @@ -16,7 +17,7 @@ import Data.Torrent.InfoHash as IH instance Arbitrary InfoHash where arbitrary = do bs <- BS.pack <$> vectorOf 20 arbitrary - pure $ fromMaybe (error "arbitrary infohash") $ byteStringToInfoHash bs + pure $ either (const (error "arbitrary infohash")) id $ safeConvert bs type TestPair = (FilePath, String) -- cgit v1.2.3