config/Path: use std::string_view instead of StringView

This commit is contained in:
Max Kellermann 2022-07-04 14:38:10 +02:00
parent c7d2cb855a
commit bd32b229b5
3 changed files with 2 additions and 5 deletions

View File

@ -27,7 +27,6 @@
#include "util/OffsetPointer.hxx" #include "util/OffsetPointer.hxx"
#include "util/ScopeExit.hxx" #include "util/ScopeExit.hxx"
#include "util/StringCompare.hxx" #include "util/StringCompare.hxx"
#include "util/StringView.hxx"
#include "util/UriExtract.hxx" #include "util/UriExtract.hxx"
#include "tag/Handler.hxx" #include "tag/Handler.hxx"
#include "tag/Generic.hxx" #include "tag/Generic.hxx"

View File

@ -37,7 +37,6 @@
#include "time/ChronoUtil.hxx" #include "time/ChronoUtil.hxx"
#include "util/UriUtil.hxx" #include "util/UriUtil.hxx"
#include "util/StringAPI.hxx" #include "util/StringAPI.hxx"
#include "util/StringView.hxx"
#include "fs/AllocatedPath.hxx" #include "fs/AllocatedPath.hxx"
#include "Stats.hxx" #include "Stats.hxx"
#include "PlaylistFile.hxx" #include "PlaylistFile.hxx"

View File

@ -23,7 +23,7 @@
#include "fs/Traits.hxx" #include "fs/Traits.hxx"
#include "fs/StandardDirectory.hxx" #include "fs/StandardDirectory.hxx"
#include "util/RuntimeError.hxx" #include "util/RuntimeError.hxx"
#include "util/StringView.hxx" #include "util/StringSplit.hxx"
#include <cassert> #include <cassert>
@ -101,8 +101,7 @@ ParsePath(const char *path)
return GetConfiguredHome() / return GetConfiguredHome() /
AllocatedPath::FromUTF8Throw(path); AllocatedPath::FromUTF8Throw(path);
} else { } else {
const auto [user, rest] = const auto [user, rest] = Split(std::string_view{path}, '/');
StringView{path}.Split('/');
return GetHome(std::string{user}.c_str()) return GetHome(std::string{user}.c_str())
/ AllocatedPath::FromUTF8Throw(rest); / AllocatedPath::FromUTF8Throw(rest);