Skip to content

Commit b1c8603

Browse files
committed
core: add custom Show instance for StorePath
before ``` StorePath {storePathHash = StorePathHashPart {unStorePathHashPart = "#F\139i\215:t\134x\151+\206\&8O*\165\STX\DC2\169\234"}, storePathName = StorePathName {unStorePathName = "testFixed"}} ``` after ``` StorePath /iali40m5597kikibjxw8cx1ssxlqnii3-testFixed ```
1 parent 6e2c03a commit b1c8603

File tree

1 file changed

+7
-1
lines changed

1 file changed

+7
-1
lines changed

hnix-store-core/src/System/Nix/StorePath.hs

Lines changed: 7 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -70,12 +70,18 @@ data StorePath = StorePath
7070
-- hello-1.2.3).
7171
storePathName :: !StorePathName
7272
}
73-
deriving (Eq, Generic, Ord, Show)
73+
deriving (Eq, Generic, Ord)
7474

7575
instance Hashable StorePath where
7676
hashWithSalt s StorePath{..} =
7777
s `hashWithSalt` storePathHash `hashWithSalt` storePathName
7878

79+
instance Show StorePath where
80+
show s =
81+
"StorePath"
82+
<> " "
83+
<> storePathToFilePath (StoreDir mempty) s
84+
7985
-- | The name portion of a Nix path.
8086
--
8187
-- 'unStorePathName' must only contain a-zA-Z0-9+._?=-, can't start

0 commit comments

Comments
 (0)