Skip to content

Commit 79a042d

Browse files
committed
Core: treewide: m clean-up
1 parent b00b303 commit 79a042d

File tree

3 files changed

+8
-9
lines changed

3 files changed

+8
-9
lines changed

hnix-store-core/src/System/Nix/Internal/Hash.hs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -212,7 +212,7 @@ instance (ValidAlgo a, Kind.KnownNat n) => ValidAlgo ('Truncated n a) where
212212
-- (leftover part), right-pads the leftovers with 0 to the truncation
213213
-- length, and combines the two strings bytewise with 'xor'.
214214
truncateDigest
215-
:: forall n a.(Kind.KnownNat n) => Digest a -> Digest ('Truncated n a)
215+
:: forall n a .(Kind.KnownNat n) => Digest a -> Digest ('Truncated n a)
216216
truncateDigest (Digest c) =
217217
Digest $ BS.pack $ fmap truncOutputByte [0.. n-1]
218218
where

hnix-store-core/tests/Derivation.hs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -20,11 +20,11 @@ processDerivation source dest = do
2020
contents <- Data.Text.IO.readFile source
2121
either
2222
fail
23-
(\ drv ->
24-
Data.Text.IO.writeFile dest
25-
. Data.Text.Lazy.toStrict
26-
. Data.Text.Lazy.Builder.toLazyText
27-
$ buildDerivation drv
23+
-- It seems to be derivation.
24+
(Data.Text.IO.writeFile dest
25+
. Data.Text.Lazy.toStrict
26+
. Data.Text.Lazy.Builder.toLazyText
27+
. buildDerivation
2828
)
2929
(Data.Attoparsec.Text.parseOnly
3030
(parseDerivation "/nix/store")

hnix-store-core/tests/Hash.hs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -51,12 +51,11 @@ spec_hash = do
5151
-- | Test that Nix-like base32 encoding roundtrips
5252
prop_nixBase32Roundtrip :: Property
5353
prop_nixBase32Roundtrip = forAllShrink nonEmptyString genericShrink $
54-
\x -> Right (BSC.pack x) === (B32.decode . B32.encode . BSC.pack $ x)
54+
\x -> pure (BSC.pack x) === (B32.decode . B32.encode . BSC.pack $ x)
5555

5656
-- | API variants
5757
prop_nixBase16Roundtrip :: Digest StorePathHashAlgo -> Property
58-
prop_nixBase16Roundtrip =
59-
\(x :: Digest StorePathHashAlgo) -> Right x === (decodeBase Base16 . encodeInBase Base16 $ x)
58+
prop_nixBase16Roundtrip x = pure x === (decodeBase Base16 . encodeInBase Base16 $ x)
6059

6160
-- | Hash encoding conversion ground-truth.
6261
-- Similiar to nix/tests/hash.sh

0 commit comments

Comments
 (0)