summaryrefslogtreecommitdiff
path: root/lib/strings.nix
diff options
context:
space:
mode:
authorfigsoda <figsoda@pm.me>2023-06-22 18:27:15 -0400
committerfigsoda <figsoda@pm.me>2023-06-22 18:27:15 -0400
commit57ca44c0aea940569d367af13894a0cb0975c502 (patch)
treee200f32b9a86daf97b1a461bb1f6d2e724311435 /lib/strings.nix
parentMerge pull request #231720 from mmilata/lndmanage-0.15.0 (diff)
downloadnixpkgs-57ca44c0aea940569d367af13894a0cb0975c502.tar.gz
lib: simplify stringToCharacters
Diffstat (limited to 'lib/strings.nix')
-rw-r--r--lib/strings.nix3
1 files changed, 2 insertions, 1 deletions
diff --git a/lib/strings.nix b/lib/strings.nix
index bb07f40d7a55..1eb6cf9c1afb 100644
--- a/lib/strings.nix
+++ b/lib/strings.nix
@@ -18,6 +18,7 @@ rec {
elemAt
filter
fromJSON
+ genList
head
isInt
isList
@@ -346,7 +347,7 @@ rec {
=> [ "�" "�" "�" "�" ]
*/
stringToCharacters = s:
- map (p: substring p 1 s) (lib.range 0 (stringLength s - 1));
+ genList (p: substring p 1 s) (stringLength s);
/* Manipulate a string character by character and replace them by
strings before concatenating the results.