libluna: Add String::from_string_view()
All checks were successful
continuous-integration/drone/push Build is passing

This commit is contained in:
apio 2023-05-01 20:03:16 +02:00
parent 53ec448e33
commit 376247ba8a
Signed by: apio
GPG Key ID: B8A7D06E42258954
2 changed files with 5 additions and 1 deletions

View File

@ -41,7 +41,7 @@ Result<int> luna_main(int argc, char** argv)
}
else
{
auto str = TRY(String::from_cstring(pathname.chars()));
auto str = TRY(String::from_string_view(pathname));
TRY(files.try_append(move(str)));
}

View File

@ -41,6 +41,10 @@ class String
static Result<String> vformat(StringView fmt, va_list ap);
static Result<String> from_cstring(const char* str);
static Result<String> from_string_view(StringView str)
{
return from_cstring(str.chars());
}
const char* chars() const
{