diff options
Diffstat (limited to 'src/libutil/parser.hh')
-rw-r--r-- | src/libutil/parser.hh | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/src/libutil/parser.hh b/src/libutil/parser.hh index 64689e283..d3bfafe75 100644 --- a/src/libutil/parser.hh +++ b/src/libutil/parser.hh @@ -1,6 +1,7 @@ #pragma once #include <optional> +#include <string_view> namespace nix { @@ -8,9 +9,7 @@ namespace nix { // separator, and modify the string argument to contain only the part after the // separator. Otherwise, wer return `std::nullopt`, and we leave the argument // string alone. -std::optional<std::string_view> splitPrefix(std::string_view & string, char separator); - -std::optional<std::string_view> splitPrefix(std::string_view & string, char separator) { +static inline std::optional<std::string_view> splitPrefix(std::string_view & string, char separator) { auto sepInstance = string.find(separator); if (sepInstance != std::string_view::npos) { |