mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-21 23:20:20 +00:00
AK: Add formatter for StringImpl.
This commit is contained in:
parent
2be7736010
commit
d781f3f6b5
Notes:
sideshowbarker
2024-07-19 01:59:06 +09:00
Author: https://github.com/asynts Commit: https://github.com/SerenityOS/serenity/commit/d781f3f6b55 Pull-request: https://github.com/SerenityOS/serenity/pull/3705 Reviewed-by: https://github.com/awesomekling
1 changed files with 8 additions and 0 deletions
|
@ -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;
|
||||
|
|
Loading…
Reference in a new issue