Skip to content

Commit f92ef1c

Browse files
authored
refactor(docgen): remove extra unsafeDiscardStringContext (#269)
It is already called on the final string, no need to call it per-item
1 parent acda996 commit f92ef1c

File tree

1 file changed

+4
-6
lines changed

1 file changed

+4
-6
lines changed

docs/per-mod/rendermd.nix

Lines changed: 4 additions & 6 deletions
Original file line numberDiff line numberDiff line change
@@ -46,17 +46,15 @@ let
4646
sanitize =
4747
v:
4848
if v ? _type && v ? text then
49-
builtins.unsafeDiscardStringContext (
50-
if v._type == "literalExpression" then "```nix\n${toString v.text}\n```" else toString v.text
51-
)
49+
if v._type == "literalExpression" then "```nix\n${toString v.text}\n```" else toString v.text
5250
else if lib.isStringLike v && !builtins.isString v then
53-
builtins.unsafeDiscardStringContext "`<${if v ? name then "derivation ${v.name}" else v}>`"
51+
"`<${if v ? name then "derivation ${v.name}" else v}>`"
5452
else if builtins.isString v then
55-
builtins.unsafeDiscardStringContext v
53+
v
5654
else if builtins.isList v then
5755
map sanitize v
5856
else if lib.isFunction v then
59-
builtins.unsafeDiscardStringContext "`<function with arguments ${
57+
"`<function with arguments ${
6058
lib.pipe v [
6159
lib.functionArgs
6260
(lib.mapAttrsToList (n: v: "${n}${lib.optionalString v "?"}"))

0 commit comments

Comments
 (0)