diff --git a/include/rfl/json/read.hpp b/include/rfl/json/read.hpp index 359a20fb..c4465498 100644 --- a/include/rfl/json/read.hpp +++ b/include/rfl/json/read.hpp @@ -8,7 +8,7 @@ #endif #include -#include +#include #include "../Processors.hpp" #include "../internal/wrap_in_rfl_array_t.hpp" @@ -30,8 +30,8 @@ auto read(const InputVarType& _obj) { /// Parses an object from JSON using reflection. template -Result> read(const std::string& _json_str) { - yyjson_doc* doc = yyjson_read(_json_str.c_str(), _json_str.size(), 0); +Result> read(std::string_view const _json_str) { + yyjson_doc* doc = yyjson_read(_json_str.data(), _json_str.size(), 0); if (!doc) { return Error("Could not parse document"); }