File tree Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Expand file tree Collapse file tree 2 files changed +6
-7
lines changed Original file line number Diff line number Diff line change @@ -166,7 +166,7 @@ instance ( Convertible e t f m
166166instance Convertible e t f m
167167 => FromValue ByteString m (NValue' t f m (NValue t f m )) where
168168 fromValueMay = \ case
169- NVStr' ns -> pure $ encodeUtf8 <$> hackyGetStringNoContext ns
169+ NVStr' ns -> pure $ encodeUtf8 <$> principledGetStringNoContext ns
170170 _ -> pure Nothing
171171 fromValue v = fromValueMay v >>= \ case
172172 Just b -> pure b
@@ -181,7 +181,7 @@ instance ( Convertible e t f m
181181 => FromValue Path m (NValue' t f m (NValue t f m )) where
182182 fromValueMay = \ case
183183 NVPath' p -> pure $ Just (Path p)
184- NVStr' ns -> pure $ Path . Text. unpack <$> hackyGetStringNoContext ns
184+ NVStr' ns -> pure $ Path . Text. unpack <$> principledGetStringNoContext ns
185185 NVSet' s _ -> case M. lookup " outPath" s of
186186 Nothing -> pure Nothing
187187 Just p -> fromValueMay @ Path p
Original file line number Diff line number Diff line change @@ -155,11 +155,6 @@ principledStringMConcat =
155155-- mempty = NixString mempty mempty
156156-- mappend = (<>)
157157
158- -- | Extract the string contents from a NixString that has no context
159- hackyGetStringNoContext :: NixString -> Maybe Text
160- hackyGetStringNoContext (NixString s c) | null c = Just s
161- | otherwise = Nothing
162-
163158-- | Extract the string contents from a NixString that has no context
164159principledGetStringNoContext :: NixString -> Maybe Text
165160principledGetStringNoContext (NixString s c) | null c = Just s
@@ -252,3 +247,7 @@ hackyMakeNixStringWithoutContext = principledMakeNixStringWithoutContext
252247hackyStringIgnoreContext :: NixString -> Text
253248hackyStringIgnoreContext = principledStringIgnoreContext
254249
250+ -- | Extract the string contents from a NixString that has no context
251+ hackyGetStringNoContext :: NixString -> Maybe Text
252+ hackyGetStringNoContext = principledGetStringNoContext
253+
You can’t perform that action at this time.
0 commit comments