1
0

better code readability

This commit is contained in:
EAimTY 2023-05-30 20:45:40 +09:00
parent c92ed4b810
commit 4513bc7955

View File

@ -142,10 +142,8 @@ impl Address {
1 + match self { 1 + match self {
Address::None => 0, Address::None => 0,
Address::DomainAddress(addr, _) => 1 + addr.len() + 2, Address::DomainAddress(addr, _) => 1 + addr.len() + 2,
Address::SocketAddress(addr) => match addr { Address::SocketAddress(SocketAddr::V4(_)) => 4 + 2,
SocketAddr::V4(_) => 4 + 2, Address::SocketAddress(SocketAddr::V6(_)) => 16 + 2,
SocketAddr::V6(_) => 2 * 8 + 2,
},
} }
} }