diff options
author | Andreas Kling <kling@serenityos.org> | 2021-11-16 01:15:21 +0100 |
---|---|---|
committer | Andreas Kling <kling@serenityos.org> | 2021-11-17 00:21:13 +0100 |
commit | 216e21a1fa95ffc87c371cdd6262467df8cdb5cd (patch) | |
tree | d58f31c31215cce39557cfcc3f35b7795334aa06 /Userland/Libraries/LibGUI/ModelIndex.h | |
parent | 008355c222980bd3520caeea9848e04dc2230df1 (diff) | |
download | serenity-216e21a1fa95ffc87c371cdd6262467df8cdb5cd.zip |
AK: Convert AK::Format formatting helpers to returning ErrorOr<void>
This isn't a complete conversion to ErrorOr<void>, 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.
Diffstat (limited to 'Userland/Libraries/LibGUI/ModelIndex.h')
-rw-r--r-- | Userland/Libraries/LibGUI/ModelIndex.h | 5 |
1 files changed, 2 insertions, 3 deletions
diff --git a/Userland/Libraries/LibGUI/ModelIndex.h b/Userland/Libraries/LibGUI/ModelIndex.h index 6e7141021d..07743383a5 100644 --- a/Userland/Libraries/LibGUI/ModelIndex.h +++ b/Userland/Libraries/LibGUI/ModelIndex.h @@ -66,12 +66,11 @@ namespace AK { template<> struct Formatter<GUI::ModelIndex> : Formatter<FormatString> { - void format(FormatBuilder& builder, const GUI::ModelIndex& value) + ErrorOr<void> format(FormatBuilder& builder, GUI::ModelIndex const& value) { if (value.internal_data()) return Formatter<FormatString>::format(builder, "ModelIndex({},{},{})", value.row(), value.column(), value.internal_data()); - else - return Formatter<FormatString>::format(builder, "ModelIndex({},{})", value.row(), value.column()); + return Formatter<FormatString>::format(builder, "ModelIndex({},{})", value.row(), value.column()); } }; |