AK: Add formatter for StringImpl.

This commit is contained in:
asynts 2020-10-07 13:24:46 +02:00 committed by Andreas Kling
parent 2be7736010
commit d781f3f6b5
Notes: sideshowbarker 2024-07-19 01:59:06 +09:00

View file

@ -130,6 +130,14 @@ inline constexpr u32 string_hash(const char* characters, size_t length)
return hash;
}
template<>
struct Formatter<StringImpl> : Formatter<StringView> {
void format(TypeErasedFormatParams& params, FormatBuilder& builder, const StringImpl& value)
{
Formatter<StringView>::format(params, builder, { value.characters(), value.length() });
}
};
}
using AK::Chomp;