mirror of
https://github.com/RGBCube/serenity
synced 2025-07-26 01:07:35 +00:00
Everywhere: Make JSON serialization fallible
This allows us to eliminate a major source of infallible allocation in the Kernel, as well as lay down the groundwork for OOM fallibility in userland.
This commit is contained in:
parent
6682afb5d4
commit
feb00b7105
18 changed files with 837 additions and 592 deletions
|
@ -85,8 +85,9 @@ private:
|
|||
template<typename Builder>
|
||||
inline void JsonArray::serialize(Builder& builder) const
|
||||
{
|
||||
JsonArraySerializer serializer { builder };
|
||||
for_each([&](auto& value) { serializer.add(value); });
|
||||
auto serializer = MUST(JsonArraySerializer<>::try_create(builder));
|
||||
for_each([&](auto& value) { MUST(serializer.add(value)); });
|
||||
MUST(serializer.finish());
|
||||
}
|
||||
|
||||
template<typename Builder>
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue