diff --git a/src/lib/dbus/UDisks2.cxx b/src/lib/dbus/UDisks2.cxx index 3ff5f3318..a2fa908f6 100644 --- a/src/lib/dbus/UDisks2.cxx +++ b/src/lib/dbus/UDisks2.cxx @@ -23,7 +23,6 @@ #include "ObjectManager.hxx" #include "util/SpanCast.hxx" #include "util/StringAPI.hxx" -#include "util/StringView.hxx" #include "util/Compiler.h" #include @@ -44,11 +43,11 @@ CheckString(I &&i) noexcept template gcc_pure -static StringView +static std::string_view CheckRecursedByteArrayToString(I &&i) noexcept { if (i.GetArgType() != DBUS_TYPE_BYTE) - return nullptr; + return {}; auto value = i.template GetFixedArray(); return ToStringView(value); @@ -56,22 +55,22 @@ CheckRecursedByteArrayToString(I &&i) noexcept template gcc_pure -static StringView +static std::string_view CheckByteArrayToString(I &&i) noexcept { if (i.GetArgType() != DBUS_TYPE_ARRAY) - return nullptr; + return {}; return CheckRecursedByteArrayToString(i.Recurse()); } template gcc_pure -static StringView +static std::string_view CheckByteArrayArrayFrontToString(I &&i) noexcept { if (i.GetArgType() != DBUS_TYPE_ARRAY) - return nullptr; + return {}; return CheckByteArrayToString(i.Recurse()); } @@ -110,8 +109,8 @@ ParseFileesystemDictEntry(Object &o, const char *name, /* get the first string in the array */ auto value = CheckByteArrayArrayFrontToString(value_i); - if (value != nullptr) - o.mount_point = {value.data, value.size}; + if (value.data() != nullptr) + o.mount_point = value; // TODO: check whether the string is a valid filesystem path }