mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2025-09-06 09:36:08 +00:00
LibCore: Rename Stream::*_or_error
to *_entire_buffer
All of our functions are `_or_error` (or are about to be), and maybe making it less reminiscient of AK::Stream will make people use it more.
This commit is contained in:
parent
ed4c2f2f8e
commit
6c7c5a6786
Notes:
sideshowbarker
2024-07-17 03:22:57 +09:00
Author: https://github.com/timschumi
Commit: 6c7c5a6786
Pull-request: https://github.com/SerenityOS/serenity/pull/16429
Reviewed-by: https://github.com/sin-ack ✅
17 changed files with 44 additions and 36 deletions
|
@ -59,7 +59,7 @@ ErrorOr<JsonValue> read_entire_file_as_json(StringView filename)
|
|||
auto file = TRY(Core::Stream::File::open(filename, Core::Stream::OpenMode::Read));
|
||||
auto json_size = TRY(file->size());
|
||||
auto json_data = TRY(ByteBuffer::create_uninitialized(json_size));
|
||||
if (!file->read_or_error(json_data.bytes()))
|
||||
if (!file->read_entire_buffer(json_data.bytes()))
|
||||
return Error::from_string_literal("Failed to read json file.");
|
||||
return JsonValue::from_string(json_data);
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue