mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 10:37:45 +00:00
AK: Add Formatter<FormatString> as helper class.
This commit is contained in:
parent
9a842ec419
commit
1160817a9e
13 changed files with 64 additions and 94 deletions
|
@ -75,17 +75,13 @@ private:
|
|||
|
||||
}
|
||||
|
||||
namespace AK {
|
||||
|
||||
template<>
|
||||
struct Formatter<JS::Cell> : Formatter<StringView> {
|
||||
struct AK::Formatter<JS::Cell> : AK::Formatter<FormatString> {
|
||||
void format(FormatBuilder& builder, const JS::Cell* cell)
|
||||
{
|
||||
if (!cell)
|
||||
Formatter<StringView>::format(builder, "Cell{nullptr}");
|
||||
Formatter<FormatString>::format(builder, "Cell{nullptr}");
|
||||
else
|
||||
Formatter<StringView>::format(builder, String::formatted("{}{{{}}}", cell->class_name(), static_cast<const void*>(cell)));
|
||||
Formatter<FormatString>::format(builder, "{}({})", cell->class_name(), cell);
|
||||
}
|
||||
};
|
||||
|
||||
}
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue