diff --git a/deps/ox/src/ox/std/strops.hpp b/deps/ox/src/ox/std/strops.hpp index afb650f5..25acc74d 100644 --- a/deps/ox/src/ox/std/strops.hpp +++ b/deps/ox/src/ox/std/strops.hpp @@ -14,26 +14,23 @@ #include "stringview.hpp" #include "types.hpp" #include "vector.hpp" -#include "writer.hpp" namespace ox { -template [[nodiscard]] -constexpr Str substr(Str const&str, std::size_t pos) noexcept { +constexpr ox::StringView substr(ox::StringView const&str, std::size_t pos) noexcept { if (str.len() >= pos) { - return Str(str.data() + pos, str.len() - pos); + return {str.data() + pos, str.len() - pos}; } - return Str(); + return {}; } -template [[nodiscard]] -constexpr ox::StringView substr(Str const&str, std::size_t start, std::size_t end) noexcept { +constexpr ox::StringView substr(ox::StringView const&str, std::size_t start, std::size_t end) noexcept { if (str.len() >= start && end >= start) { - return Str(str.data() + start, end - start); + return {str.data() + start, end - start}; } - return Str(); + return {}; } template