diff options
| author | Robert Hensing <robert@roberthensing.nl> | 2022-12-31 00:49:04 +0100 |
|---|---|---|
| committer | Robert Hensing <robert@roberthensing.nl> | 2022-12-31 01:33:47 +0100 |
| commit | 23c25d5231856e8cfd60049582c865da97bc5d44 (patch) | |
| tree | f1698ac196e1f2d9fe31e16cc3e763c5ff044585 | |
| parent | lib.strings: isMoreCoercibleString -> isConvertibleWithToString (diff) | |
| download | nixpkgs-23c25d5231856e8cfd60049582c865da97bc5d44.tar.gz | |
lib.strings.isConvertibleWithToString: Refactor to reuse isStringLike
| -rw-r--r-- | lib/strings.nix | 7 |
1 files changed, 3 insertions, 4 deletions
diff --git a/lib/strings.nix b/lib/strings.nix index 89574bc8367c..db89f60c480c 100644 --- a/lib/strings.nix +++ b/lib/strings.nix @@ -810,10 +810,9 @@ rec { null, bool, list of similarly coercible values. */ isConvertibleWithToString = x: - elem (typeOf x) [ "path" "string" "null" "int" "float" "bool" ] || - (isList x && lib.all isConvertibleWithToString x) || - x ? outPath || - x ? __toString; + isStringLike x || + elem (typeOf x) [ "null" "int" "float" "bool" ] || + (isList x && lib.all isConvertibleWithToString x); /* Check whether a value can be coerced to a string. The value must be a string, path, or attribute set. |
