Kernel: Fix common misuse of KString in debug messages

This commit is contained in:
Ben Wiederhake 2021-10-30 14:06:55 +02:00 committed by Andreas Kling
parent 6ccfa3e75e
commit fa018d3ba1
Notes: sideshowbarker 2024-07-18 01:44:39 +09:00

View file

@ -63,6 +63,14 @@ struct Formatter<OwnPtr<Kernel::KString>> : Formatter<StringView> {
}
};
template<>
struct Formatter<NonnullOwnPtr<Kernel::KString>> : Formatter<StringView> {
void format(FormatBuilder& builder, NonnullOwnPtr<Kernel::KString> const& value)
{
Formatter<StringView>::format(builder, value->view());
}
};
template<>
struct Traits<NonnullOwnPtr<Kernel::KString>> : public GenericTraits<NonnullOwnPtr<Kernel::KString>> {
using PeekType = Kernel::KString*;