From 216e21a1fa95ffc87c371cdd6262467df8cdb5cd Mon Sep 17 00:00:00 2001 From: Andreas Kling Date: Tue, 16 Nov 2021 01:15:21 +0100 Subject: AK: Convert AK::Format formatting helpers to returning ErrorOr This isn't a complete conversion to ErrorOr, but a good chunk. The end goal here is to propagate buffer allocation failures to the caller, and allow the use of TRY() with formatting functions. --- Userland/Games/Hearts/Player.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) (limited to 'Userland/Games/Hearts') diff --git a/Userland/Games/Hearts/Player.h b/Userland/Games/Hearts/Player.h index 328c5016bc..2fdc7945fd 100644 --- a/Userland/Games/Hearts/Player.h +++ b/Userland/Games/Hearts/Player.h @@ -63,8 +63,8 @@ public: template<> struct AK::Formatter : Formatter { - void format(FormatBuilder& builder, Hearts::Player const& player) + ErrorOr format(FormatBuilder& builder, Hearts::Player const& player) { - builder.put_string(player.name); + return builder.put_string(player.name); } }; -- cgit v1.2.3