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/flake | |
parent | 86a1121d16f7eeb594955e39ff4e6fcd69f1b8c5 (diff) | |
parent | 61e21b25576f7f3491f6a837bf59d8b44c6897a0 (diff) |
Merge "Delete hasPrefix and hasSuffix from the codebase" into main
Diffstat (limited to 'src/libexpr/flake')
-rw-r--r-- | src/libexpr/flake/config.cc | 2 | ||||
-rw-r--r-- | src/libexpr/flake/flakeref.cc | 2 |
2 files changed, 2 insertions, 2 deletions
diff --git a/src/libexpr/flake/config.cc b/src/libexpr/flake/config.cc index e89014862..b9613462a 100644 --- a/src/libexpr/flake/config.cc +++ b/src/libexpr/flake/config.cc @@ -35,7 +35,7 @@ void ConfigFile::apply() for (auto & [name, value] : settings) { - auto baseName = hasPrefix(name, "extra-") ? std::string(name, 6) : name; + auto baseName = name.starts_with("extra-") ? std::string(name, 6) : name; // FIXME: Move into libutil/config.cc. std::string valueS; diff --git a/src/libexpr/flake/flakeref.cc b/src/libexpr/flake/flakeref.cc index e1bce90bc..1c90bfc43 100644 --- a/src/libexpr/flake/flakeref.cc +++ b/src/libexpr/flake/flakeref.cc @@ -186,7 +186,7 @@ std::pair<FlakeRef, std::string> parseFlakeRefWithFragment( } } else { - if (!hasPrefix(path, "/")) + if (!path.starts_with("/")) throw BadURL("flake reference '%s' is not an absolute path", url); auto query = decodeQuery(match[2]); path = canonPath(path + "/" + getOr(query, "dir", "")); |