From d781f3f6b55ca7d103e97bc1cb7d50bf6f993d71 Mon Sep 17 00:00:00 2001 From: asynts Date: Wed, 7 Oct 2020 13:24:46 +0200 Subject: [PATCH] AK: Add formatter for StringImpl. --- AK/StringImpl.h | 8 ++++++++ 1 file changed, 8 insertions(+) diff --git a/AK/StringImpl.h b/AK/StringImpl.h index 1b9360c8f03..e91c7fb4e60 100644 --- a/AK/StringImpl.h +++ b/AK/StringImpl.h @@ -130,6 +130,14 @@ inline constexpr u32 string_hash(const char* characters, size_t length) return hash; } +template<> +struct Formatter : Formatter { + void format(TypeErasedFormatParams& params, FormatBuilder& builder, const StringImpl& value) + { + Formatter::format(params, builder, { value.characters(), value.length() }); + } +}; + } using AK::Chomp;