treewide: isCoercibleToString -> isMoreCoercibleToString

No change in behavior.
This commit is contained in:
Robert Hensing
2022-12-28 23:38:06 +01:00
parent 68b6443ed6
commit fed5dc66f8
4 changed files with 5 additions and 5 deletions

View File

@@ -810,7 +810,7 @@ rec {
*/ */
isMoreCoercibleToString = x: isMoreCoercibleToString = x:
elem (typeOf x) [ "path" "string" "null" "int" "float" "bool" ] || elem (typeOf x) [ "path" "string" "null" "int" "float" "bool" ] ||
(isList x && lib.all isCoercibleToString x) || (isList x && lib.all isMoreCoercibleToString x) ||
x ? outPath || x ? outPath ||
x ? __toString; x ? __toString;

View File

@@ -54,7 +54,7 @@ let
concatStringsSep concatStringsSep
escapeNixString escapeNixString
hasInfix hasInfix
isCoercibleToString isMoreCoercibleToString
isSimpleCoercibleToString isSimpleCoercibleToString
; ;
inherit (lib.trivial) inherit (lib.trivial)
@@ -480,7 +480,7 @@ rec {
path = mkOptionType { path = mkOptionType {
name = "path"; name = "path";
descriptionClass = "noun"; descriptionClass = "noun";
check = x: isCoercibleToString x && builtins.substring 0 1 (toString x) == "/"; check = x: isMoreCoercibleToString x && builtins.substring 0 1 (toString x) == "/";
merge = mergeEqualOption; merge = mergeEqualOption;
}; };

View File

@@ -42,7 +42,7 @@ let
else if isDerivation v then toString v else if isDerivation v then toString v
else if builtins.isPath v then toString v else if builtins.isPath v then toString v
else if isString v then v else if isString v then v
else if strings.isCoercibleToString v then toString v else if strings.isMoreCoercibleToString v then toString v
else abort "The nix conf value: ${toPretty {} v} can not be encoded"; else abort "The nix conf value: ${toPretty {} v} can not be encoded";
mkKeyValue = k: v: "${escape [ "=" ] k} = ${mkValueString v}"; mkKeyValue = k: v: "${escape [ "=" ] k} = ${mkValueString v}";

View File

@@ -18,7 +18,7 @@ let
in in
lib.concatStrings (lib.mapAttrsToList toArg args); lib.concatStrings (lib.mapAttrsToList toArg args);
isPathType = x: lib.strings.isCoercibleToString x && builtins.substring 0 1 (toString x) == "/"; isPathType = x: lib.strings.isMoreCoercibleToString x && builtins.substring 0 1 (toString x) == "/";
in in
{ {