[ox/fs] Make FileAddress::getPath return a StringView

This commit is contained in:
Gary Talent 2023-11-30 01:01:01 -06:00
parent 2a692fc46e
commit 3c9ce4436a

View File

@ -96,12 +96,12 @@ class FileAddress {
} }
} }
constexpr Result<const char*> getPath() const noexcept { constexpr Result<ox::StringView> getPath() const noexcept {
switch (m_type) { switch (m_type) {
case FileAddressType::Path: case FileAddressType::Path:
return m_data.path; return ox::StringView(m_data.path);
case FileAddressType::ConstPath: case FileAddressType::ConstPath:
return m_data.constPath; return ox::StringView(m_data.constPath);
default: default:
return OxError(1); return OxError(1);
} }