diff --git a/AK/Stream.cpp b/AK/Stream.cpp index 8ea84d84a7..233224fd6a 100644 --- a/AK/Stream.cpp +++ b/AK/Stream.cpp @@ -98,7 +98,7 @@ ErrorOr Stream::write_until_depleted(ReadonlyBytes buffer) return {}; } -ErrorOr Stream::format_impl(StringView fmtstr, TypeErasedFormatParams& parameters) +ErrorOr Stream::write_formatted_impl(StringView fmtstr, TypeErasedFormatParams& parameters) { StringBuilder builder; TRY(vformat(builder, fmtstr, parameters)); diff --git a/AK/Stream.h b/AK/Stream.h index b821a10ea6..bc2db6f12d 100644 --- a/AK/Stream.h +++ b/AK/Stream.h @@ -77,13 +77,11 @@ public: return write_until_depleted({ &value, sizeof(value) }); } - virtual ErrorOr format_impl(StringView, TypeErasedFormatParams&); - template - ErrorOr format(CheckedFormatString&& fmtstr, Parameters const&... parameters) + ErrorOr write_formatted(CheckedFormatString&& fmtstr, Parameters const&... parameters) { VariadicFormatParams variadic_format_params { parameters... }; - TRY(format_impl(fmtstr.view(), variadic_format_params)); + TRY(write_formatted_impl(fmtstr.view(), variadic_format_params)); return {}; } @@ -108,6 +106,9 @@ protected: /// content size to be in order to reduce allocations (does not affect /// actual reading). ErrorOr read_until_eof_impl(size_t block_size, size_t expected_file_size = 0); + +private: + ErrorOr write_formatted_impl(StringView, TypeErasedFormatParams&); }; enum class SeekMode { diff --git a/Userland/Libraries/LibJS/Print.cpp b/Userland/Libraries/LibJS/Print.cpp index c8a50aa778..ae77c6e2d7 100644 --- a/Userland/Libraries/LibJS/Print.cpp +++ b/Userland/Libraries/LibJS/Print.cpp @@ -141,9 +141,9 @@ ErrorOr js_out(JS::PrintContext& print_context, CheckedFormatString