better code readability
This commit is contained in:
parent
c92ed4b810
commit
4513bc7955
@ -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,
|
|
||||||
},
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
Loading…
x
Reference in New Issue
Block a user