aboutsummaryrefslogtreecommitdiff
path: root/src/libexpr/eval-settings.cc
diff options
context:
space:
mode:
authorjade <lix@jade.fyi>2024-03-18 12:01:39 -0600
committerGerrit Code Review <gerrit@lix>2024-03-18 12:01:39 -0600
commit47a237f7ec594c409a7abbbfe0ff0170a9970183 (patch)
treeb1300e42617d2c728a1688e066ffb6f3a252bfbd /src/libexpr/eval-settings.cc
parent86a1121d16f7eeb594955e39ff4e6fcd69f1b8c5 (diff)
parent61e21b25576f7f3491f6a837bf59d8b44c6897a0 (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.cc4
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);