1
Fork 0
mirror of https://github.com/RGBCube/serenity synced 2025-07-27 15:37:46 +00:00

AK: Remove infallible version of StringBuilder::to_byte_buffer

Also drop the try_ prefix from the fallible function, as it is no longer
needed to distinguish the two.
This commit is contained in:
Linus Groh 2023-03-09 15:00:14 +00:00
parent ad5e8f2742
commit e76394d96c
13 changed files with 21 additions and 28 deletions

View file

@ -50,7 +50,7 @@ ErrorOr<void> DomainListModel::save()
TRY(builder.try_appendff("{}\n", domain));
auto file = TRY(Core::File::open(filter_list_file_path(), Core::File::OpenMode::Write));
TRY(file->write(TRY(builder.try_to_byte_buffer()).bytes()));
TRY(file->write(TRY(builder.to_byte_buffer()).bytes()));
return {};
}

View file

@ -277,7 +277,7 @@ ErrorOr<int> serenity_main(Main::Arguments arguments)
}
auto file = file_or_error.release_value().release_stream();
auto byte_buffer_or_error = full_backtrace.try_to_byte_buffer();
auto byte_buffer_or_error = full_backtrace.to_byte_buffer();
if (byte_buffer_or_error.is_error()) {
GUI::MessageBox::show(window, DeprecatedString::formatted("Couldn't create backtrace: {}.", byte_buffer_or_error.release_error()), "Saving backtrace failed"sv, GUI::MessageBox::Type::Error);
return;