mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-11-22 07:30:19 +00:00
AK: Don't inherit Formatter<ErrorOr<T>> for Formatter<IPv6Address>
This commit is contained in:
parent
d5152c49a1
commit
92cea3216f
Notes:
sideshowbarker
2024-07-17 06:51:48 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/92cea3216f Pull-request: https://github.com/SerenityOS/serenity/pull/16987 Reviewed-by: https://github.com/linusg ✅
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…
Reference in a new issue