Skip to content

Commit ffc254c

Browse files
committed
remote: fix Wincomplete-uni-patterns warnings
1 parent ac8f9b8 commit ffc254c

File tree

1 file changed

+7
-6
lines changed

1 file changed

+7
-6
lines changed

hnix-store-remote/tests/NixDaemon.hs

Lines changed: 7 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -7,6 +7,7 @@ import qualified System.Environment as Env
77
import Control.Exception ( bracket )
88
import Control.Concurrent ( threadDelay )
99
import qualified Data.ByteString.Char8 as BSC
10+
import qualified Data.Either
1011
import qualified Data.HashSet as HS
1112
import qualified Data.Map.Strict as M
1213
import System.Directory
@@ -159,13 +160,13 @@ withPath action = do
159160
-- | dummy path, adds <tmp>/dummpy with "Hello World" contents
160161
dummy :: MonadStore StorePath
161162
dummy = do
162-
let Right n = makeStorePathName "dummy"
163-
addToStore @SHA256 n (dumpPath "dummy") False False
163+
let name = Data.Either.fromRight (error "impossible") $ makeStorePathName "dummy"
164+
addToStore @SHA256 name (dumpPath "dummy") False False
164165

165166
invalidPath :: StorePath
166167
invalidPath =
167-
let Right n = makeStorePathName "invalid"
168-
in StorePath (mkStorePathHashPart "invalid") n
168+
let name = Data.Either.fromRight (error "impossible") $ makeStorePathName "invalid"
169+
in StorePath (mkStorePathHashPart "invalid") name
169170

170171
withBuilder :: (StorePath -> MonadStore a) -> MonadStore a
171172
withBuilder action = do
@@ -250,8 +251,8 @@ spec_protocol = Hspec.around withNixDaemon $
250251
context "addToStore" $
251252
itRights "adds file to store" $ do
252253
fp <- liftIO $ writeSystemTempFile "addition" "lal"
253-
let Right n = makeStorePathName "tmp-addition"
254-
res <- addToStore @SHA256 n (dumpPath fp) False False
254+
let name = Data.Either.fromRight (error "impossible") $ makeStorePathName "tmp-addition"
255+
res <- addToStore @SHA256 name (dumpPath fp) False False
255256
liftIO $ print res
256257

257258
context "with dummy" $ do

0 commit comments

Comments
 (0)