aboutsummaryrefslogtreecommitdiff
diff options
context:
space:
mode:
-rw-r--r--src/libexpr/eval.hh4
-rw-r--r--src/libexpr/parser.y6
2 files changed, 5 insertions, 5 deletions
diff --git a/src/libexpr/eval.hh b/src/libexpr/eval.hh
index 34a212aa4..f3e8a34bd 100644
--- a/src/libexpr/eval.hh
+++ b/src/libexpr/eval.hh
@@ -144,8 +144,8 @@ public:
Expr * parseExprFromFile(const Path & path, StaticEnv & staticEnv);
/* Parse a Nix expression from the specified string. */
- Expr * parseExprFromString(const string & s, const Path & basePath, StaticEnv & staticEnv);
- Expr * parseExprFromString(const string & s, const Path & basePath);
+ Expr * parseExprFromString(std::string_view s, const Path & basePath, StaticEnv & staticEnv);
+ Expr * parseExprFromString(std::string_view s, const Path & basePath);
Expr * parseStdin();
diff --git a/src/libexpr/parser.y b/src/libexpr/parser.y
index afa1fd439..9c769e803 100644
--- a/src/libexpr/parser.y
+++ b/src/libexpr/parser.y
@@ -611,13 +611,13 @@ Expr * EvalState::parseExprFromFile(const Path & path, StaticEnv & staticEnv)
}
-Expr * EvalState::parseExprFromString(const string & s, const Path & basePath, StaticEnv & staticEnv)
+Expr * EvalState::parseExprFromString(std::string_view s, const Path & basePath, StaticEnv & staticEnv)
{
- return parse(s.c_str(), "(string)", basePath, staticEnv);
+ return parse(s.data(), "(string)", basePath, staticEnv);
}
-Expr * EvalState::parseExprFromString(const string & s, const Path & basePath)
+Expr * EvalState::parseExprFromString(std::string_view s, const Path & basePath)
{
return parseExprFromString(s, basePath, staticBaseEnv);
}