diff options
author | Ben Siraphob <bensiraphob@gmail.com> | 2021-07-27 15:13:31 +0700 |
---|---|---|
committer | GitHub <noreply@github.com> | 2021-07-27 15:13:31 +0700 |
commit | b63a54f81ce96391e6da6aab5965926e7cdbce47 (patch) | |
tree | ae8f9eca6965b3eb7e919548723c46ba663525c2 /nixos/modules/services/mail/postfix.nix | |
parent | d82543f22d9e778a051ee866e6d2d8716a1cae0d (diff) | |
parent | 1c2a2b0a0848d58407fb4ff73a8dc1e854f5a270 (diff) |
Merge pull request #110742 from siraben/deprecate-fold
Diffstat (limited to 'nixos/modules/services/mail/postfix.nix')
-rw-r--r-- | nixos/modules/services/mail/postfix.nix | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/nixos/modules/services/mail/postfix.nix b/nixos/modules/services/mail/postfix.nix index 35639e1bbc837..9b0a5bba2feba 100644 --- a/nixos/modules/services/mail/postfix.nix +++ b/nixos/modules/services/mail/postfix.nix @@ -194,7 +194,7 @@ let # We need to handle the last column specially here, because it's # open-ended (command + args). lines = [ labels labelDefaults ] ++ (map (l: init l ++ [""]) masterCf); - in fold foldLine (genList (const 0) (length labels)) lines; + in foldr foldLine (genList (const 0) (length labels)) lines; # Pad a string with spaces from the right (opposite of fixedWidthString). pad = width: str: let @@ -203,7 +203,7 @@ let in str + optionalString (padWidth > 0) padding; # It's + 2 here, because that's the amount of spacing between columns. - fullWidth = fold (width: acc: acc + width + 2) 0 maxWidths; + fullWidth = foldr (width: acc: acc + width + 2) 0 maxWidths; formatLine = line: concatStringsSep " " (zipListsWith pad maxWidths line); |