diff --git a/AK/String.cpp b/AK/String.cpp index dae488464cb..f20a4ae61e2 100644 --- a/AK/String.cpp +++ b/AK/String.cpp @@ -515,7 +515,7 @@ InputStream& operator>>(InputStream& stream, String& string) } } -String String::vformatted(StringView fmtstr, TypeErasedFormatParams params) +String String::vformatted(StringView fmtstr, TypeErasedFormatParams& params) { StringBuilder builder; vformat(builder, fmtstr, params); diff --git a/AK/String.h b/AK/String.h index 9bc3e5e2d14..f0437296242 100644 --- a/AK/String.h +++ b/AK/String.h @@ -265,12 +265,13 @@ public: return String((const char*)buffer.data(), buffer.size(), should_chomp); } - [[nodiscard]] static String vformatted(StringView fmtstr, TypeErasedFormatParams); + [[nodiscard]] static String vformatted(StringView fmtstr, TypeErasedFormatParams&); template [[nodiscard]] static String formatted(CheckedFormatString&& fmtstr, const Parameters&... parameters) { - return vformatted(fmtstr.view(), VariadicFormatParams { parameters... }); + VariadicFormatParams variadic_format_parameters { parameters... }; + return vformatted(fmtstr.view(), variadic_format_parameters); } template