diff --git a/Userland/Libraries/LibCore/DirIterator.cpp b/Userland/Libraries/LibCore/DirIterator.cpp index 83d4f32786d..d712b2b7aa1 100644 --- a/Userland/Libraries/LibCore/DirIterator.cpp +++ b/Userland/Libraries/LibCore/DirIterator.cpp @@ -31,11 +31,11 @@ namespace Core { -DirIterator::DirIterator(const StringView& path, Flags flags) - : m_path(path) +DirIterator::DirIterator(String path, Flags flags) + : m_path(move(path)) , m_flags(flags) { - m_dir = opendir(path.to_string().characters()); + m_dir = opendir(m_path.characters()); if (!m_dir) { m_error = errno; } diff --git a/Userland/Libraries/LibCore/DirIterator.h b/Userland/Libraries/LibCore/DirIterator.h index 7f423b4f173..78501f3d62f 100644 --- a/Userland/Libraries/LibCore/DirIterator.h +++ b/Userland/Libraries/LibCore/DirIterator.h @@ -40,7 +40,7 @@ public: SkipParentAndBaseDir = 0x2, }; - DirIterator(const StringView& path, Flags = Flags::NoFlags); + explicit DirIterator(String path, Flags = Flags::NoFlags); ~DirIterator(); bool has_error() const { return m_error != 0; }