mirror of
https://github.com/RGBCube/serenity
synced 2025-07-25 21:57:43 +00:00
WebServer: Make ErrorOr unwrapping more idiomatic
This still not propagates errors properly, but is at least (more) consistent with the codebase.
This commit is contained in:
parent
022b416570
commit
e824a2da90
2 changed files with 6 additions and 7 deletions
|
@ -226,9 +226,8 @@ static String folder_image_data()
|
|||
{
|
||||
static String cache;
|
||||
if (cache.is_empty()) {
|
||||
auto file_or_error = Core::MappedFile::map("/res/icons/16x16/filetype-folder.png");
|
||||
VERIFY(!file_or_error.is_error());
|
||||
cache = encode_base64(file_or_error.value()->bytes());
|
||||
auto file = Core::MappedFile::map("/res/icons/16x16/filetype-folder.png").release_value_but_fixme_should_propagate_errors();
|
||||
cache = encode_base64(file->bytes());
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
@ -237,9 +236,8 @@ static String file_image_data()
|
|||
{
|
||||
static String cache;
|
||||
if (cache.is_empty()) {
|
||||
auto file_or_error = Core::MappedFile::map("/res/icons/16x16/filetype-unknown.png");
|
||||
VERIFY(!file_or_error.is_error());
|
||||
cache = encode_base64(file_or_error.value()->bytes());
|
||||
auto file = Core::MappedFile::map("/res/icons/16x16/filetype-unknown.png").release_value_but_fixme_should_propagate_errors();
|
||||
cache = encode_base64(file->bytes());
|
||||
}
|
||||
return cache;
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue