diff options
author | Profpatsch <mail@profpatsch.de> | 2016-12-06 23:19:34 +0100 |
---|---|---|
committer | GitHub <noreply@github.com> | 2016-12-06 23:19:34 +0100 |
commit | 271c0f54518a8e5798cf7b27d99947c64998659e (patch) | |
tree | 1008e9d56e89d272079c18bfaeb17cf1f12e28a2 /lib/generators.nix | |
parent | 80f2e535b35c5d099ade15aa5c74bf0736e54919 (diff) | |
download | nixlib-271c0f54518a8e5798cf7b27d99947c64998659e.tar nixlib-271c0f54518a8e5798cf7b27d99947c64998659e.tar.gz nixlib-271c0f54518a8e5798cf7b27d99947c64998659e.tar.bz2 nixlib-271c0f54518a8e5798cf7b27d99947c64998659e.tar.lz nixlib-271c0f54518a8e5798cf7b27d99947c64998659e.tar.xz nixlib-271c0f54518a8e5798cf7b27d99947c64998659e.tar.zst nixlib-271c0f54518a8e5798cf7b27d99947c64998659e.zip |
lib/generators: mkKeyValueLine -> mkKeyValueLine (#20920)
Rename, since the previous name was potentially confusing.
Diffstat (limited to 'lib/generators.nix')
-rw-r--r-- | lib/generators.nix | 8 |
1 files changed, 4 insertions, 4 deletions
diff --git a/lib/generators.nix b/lib/generators.nix index 2c0cf5775f47..4d3c920b0ae3 100644 --- a/lib/generators.nix +++ b/lib/generators.nix @@ -21,10 +21,10 @@ rec { * character sep. If sep appears in k, it is escaped. * Helper for synaxes with different separators. * - * mkKeyValueLine ":" "f:oo" "bar" + * mkKeyValueDefault ":" "f:oo" "bar" * > "f\:oo:bar" */ - mkKeyValueLine = sep: k: v: + mkKeyValueDefault = sep: k: v: "${libStr.escape [sep] k}${sep}${toString v}"; @@ -33,7 +33,7 @@ rec { * mkKeyValue is the same as in toINI. */ toKeyValue = { - mkKeyValue ? mkKeyValueLine "=" + mkKeyValue ? mkKeyValueDefault "=" }: attrs: let mkLine = k: v: mkKeyValue k v + "\n"; in libStr.concatStrings (libAttr.mapAttrsToList mkLine attrs); @@ -63,7 +63,7 @@ rec { # apply transformations (e.g. escapes) to section names mkSectionName ? (name: libStr.escape [ "[" "]" ] name), # format a setting line from key and value - mkKeyValue ? mkKeyValueLine "=" + mkKeyValue ? mkKeyValueDefault "=" }: attrsOfAttrs: let # map function to string for each key val |