1
0
Fork 0
mirror of https://github.com/NixOS/nix synced 2025-06-26 07:31:15 +02:00

Clean up resolveSearchPathElem

We should use `std::optional<std::string>` not `std::pair<bool,
std::string>` for an optional string.
This commit is contained in:
John Ericson 2023-06-23 12:31:09 -04:00
parent 8d871e1822
commit 87dcd09047
3 changed files with 37 additions and 30 deletions

View file

@ -317,7 +317,7 @@ private:
SearchPath searchPath;
std::map<std::string, std::pair<bool, std::string>> searchPathResolved;
std::map<std::string, std::optional<std::string>> searchPathResolved;
/**
* Cache used by checkSourcePath().
@ -434,9 +434,13 @@ public:
SourcePath findFile(SearchPath & searchPath, const std::string_view path, const PosIdx pos = noPos);
/**
* Try to resolve a search path value (not the optinal key part)
*
* If the specified search path element is a URI, download it.
*
* If it is not found, return `std::nullopt`
*/
std::pair<bool, std::string> resolveSearchPathElem(const SearchPathElem & elem);
std::optional<std::string> resolveSearchPathElem(const std::string & value);
/**
* Evaluate an expression to normal form