Unverified Commit cb6c5083 authored by Silvan Mosberger's avatar Silvan Mosberger Committed by GitHub
Browse files

lib.strings.trimWith: Refactor scoping (#339001)

parents 88c70120 8a207815
Loading
Loading
Loading
Loading
+4 −3
Original line number Diff line number Diff line
@@ -408,7 +408,6 @@ rec {
      start ? false,
      end ? false,
    }:
    s:
    let
      # Define our own whitespace character class instead of using
      # `[:space:]`, which is not well-defined.
@@ -425,7 +424,9 @@ rec {
          "(.*[^${chars}])[${chars}]*"
        else
          "(.*)";

    in
    s:
    let
      # If the string was empty or entirely whitespace,
      # then the regex may not match and `res` will be `null`.
      res = match regex s;