diff options
author | jade <lix@jade.fyi> | 2024-03-18 12:01:39 -0600 |
---|---|---|
committer | Gerrit Code Review <gerrit@lix> | 2024-03-18 12:01:39 -0600 |
commit | 47a237f7ec594c409a7abbbfe0ff0170a9970183 (patch) | |
tree | b1300e42617d2c728a1688e066ffb6f3a252bfbd /src/libexpr/eval-settings.cc | |
parent | 86a1121d16f7eeb594955e39ff4e6fcd69f1b8c5 (diff) | |
parent | 61e21b25576f7f3491f6a837bf59d8b44c6897a0 (diff) |
Merge "Delete hasPrefix and hasSuffix from the codebase" into main
Diffstat (limited to 'src/libexpr/eval-settings.cc')
-rw-r--r-- | src/libexpr/eval-settings.cc | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/src/libexpr/eval-settings.cc b/src/libexpr/eval-settings.cc index 89ca198d8..046ca557d 100644 --- a/src/libexpr/eval-settings.cc +++ b/src/libexpr/eval-settings.cc @@ -29,7 +29,7 @@ static Strings parseNixPath(const std::string & s) if (*p == ':') { auto prefix = std::string(start2, s.end()); - if (EvalSettings::isPseudoUrl(prefix) || hasPrefix(prefix, "flake:")) { + if (EvalSettings::isPseudoUrl(prefix) || prefix.starts_with("flake:")) { ++p; while (p != s.end() && *p != ':') ++p; } @@ -82,7 +82,7 @@ bool EvalSettings::isPseudoUrl(std::string_view s) std::string EvalSettings::resolvePseudoUrl(std::string_view url) { - if (hasPrefix(url, "channel:")) + if (url.starts_with("channel:")) return "https://nixos.org/channels/" + std::string(url.substr(8)) + "/nixexprs.tar.xz"; else return std::string(url); |