mirror of
https://github.com/LadybirdBrowser/ladybird.git
synced 2024-09-11 13:36:13 +03:00
AK: Don't inherit Formatter<ErrorOr<T>> for Formatter<IPv4Address>
This commit is contained in:
parent
2150e1b3a5
commit
d5152c49a1
Notes:
sideshowbarker
2024-07-17 06:40:21 +09:00
Author: https://github.com/MacDue Commit: https://github.com/SerenityOS/serenity/commit/d5152c49a1 Pull-request: https://github.com/SerenityOS/serenity/pull/16987 Reviewed-by: https://github.com/linusg ✅
@ -158,18 +158,18 @@ struct Traits<IPv4Address> : public GenericTraits<IPv4Address> {
|
||||
|
||||
#ifdef KERNEL
|
||||
template<>
|
||||
struct Formatter<IPv4Address> : Formatter<ErrorOr<NonnullOwnPtr<Kernel::KString>>> {
|
||||
struct Formatter<IPv4Address> : Formatter<StringView> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, IPv4Address value)
|
||||
{
|
||||
return Formatter<ErrorOr<NonnullOwnPtr<Kernel::KString>>>::format(builder, TRY(value.to_string()));
|
||||
return Formatter<StringView>::format(builder, TRY(value.to_string())->view());
|
||||
}
|
||||
};
|
||||
#else
|
||||
template<>
|
||||
struct Formatter<IPv4Address> : Formatter<DeprecatedString> {
|
||||
struct Formatter<IPv4Address> : Formatter<StringView> {
|
||||
ErrorOr<void> format(FormatBuilder& builder, IPv4Address value)
|
||||
{
|
||||
return Formatter<DeprecatedString>::format(builder, value.to_deprecated_string());
|
||||
return Formatter<StringView>::format(builder, value.to_deprecated_string());
|
||||
}
|
||||
};
|
||||
#endif
|
||||
|
Loading…
Reference in New Issue
Block a user