mirror of
https://github.com/RGBCube/serenity
synced 2025-05-31 10:58:12 +00:00
LibCore: Do not return an Optional from Resource:::filesystem_path
This API never returns OptionalNone, and all callers already assume as much.
This commit is contained in:
parent
2a1fc96650
commit
98a82565cd
6 changed files with 16 additions and 9 deletions
|
@ -11,6 +11,7 @@
|
|||
#include <LibCore/ResourceImplementationFile.h>
|
||||
|
||||
namespace Core {
|
||||
|
||||
ResourceImplementationFile::ResourceImplementationFile(String base_directory)
|
||||
: m_base_directory(move(base_directory))
|
||||
{
|
||||
|
@ -33,14 +34,14 @@ ErrorOr<NonnullRefPtr<Resource>> ResourceImplementationFile::load_from_resource_
|
|||
Vector<String> ResourceImplementationFile::child_names_for_resource_scheme(Resource const& resource)
|
||||
{
|
||||
Vector<String> children;
|
||||
Core::DirIterator it(resource.filesystem_path().release_value().to_deprecated_string(), Core::DirIterator::SkipParentAndBaseDir);
|
||||
Core::DirIterator it(resource.filesystem_path().to_deprecated_string(), Core::DirIterator::SkipParentAndBaseDir);
|
||||
while (it.has_next())
|
||||
children.append(MUST(String::from_deprecated_string(it.next_path())));
|
||||
|
||||
return children;
|
||||
}
|
||||
|
||||
Optional<String> ResourceImplementationFile::filesystem_path_for_resource_scheme(String const& relative_path)
|
||||
String ResourceImplementationFile::filesystem_path_for_resource_scheme(String const& relative_path)
|
||||
{
|
||||
return MUST(String::from_deprecated_string(LexicalPath::join(m_base_directory, relative_path).string()));
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue