mirror of
https://github.com/RGBCube/serenity
synced 2025-07-27 09:37:34 +00:00
AK: Don't inherit Formatter<ErrorOr<T>> for Formatter<IPv6Address>
This commit is contained in:
parent
d5152c49a1
commit
92cea3216f
1 changed files with 4 additions and 4 deletions
|
@ -281,18 +281,18 @@ struct Traits<IPv6Address> : public GenericTraits<IPv6Address> {
|
||||||
|
|
||||||
#ifdef KERNEL
|
#ifdef KERNEL
|
||||||
template<>
|
template<>
|
||||||
struct Formatter<IPv6Address> : Formatter<ErrorOr<NonnullOwnPtr<Kernel::KString>>> {
|
struct Formatter<IPv6Address> : Formatter<StringView> {
|
||||||
ErrorOr<void> format(FormatBuilder& builder, IPv6Address const& value)
|
ErrorOr<void> format(FormatBuilder& builder, IPv6Address const& value)
|
||||||
{
|
{
|
||||||
return Formatter<ErrorOr<NonnullOwnPtr<Kernel::KString>>>::format(builder, TRY(value.to_string()));
|
return Formatter<StringView>::format(builder, TRY(value.to_string())->view());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#else
|
#else
|
||||||
template<>
|
template<>
|
||||||
struct Formatter<IPv6Address> : Formatter<DeprecatedString> {
|
struct Formatter<IPv6Address> : Formatter<StringView> {
|
||||||
ErrorOr<void> format(FormatBuilder& builder, IPv6Address const& value)
|
ErrorOr<void> format(FormatBuilder& builder, IPv6Address const& value)
|
||||||
{
|
{
|
||||||
return Formatter<DeprecatedString>::format(builder, value.to_deprecated_string());
|
return Formatter<StringView>::format(builder, value.to_deprecated_string());
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
#endif
|
#endif
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue