Fix build

This commit is contained in:
Mygod
2020-05-22 16:03:46 +08:00
committed by ty
parent 7917683121
commit 4a1312c862
+3 -3
View File
@@ -271,9 +271,9 @@ impl UdpAssociation {
fn serialize(saddr: &SocketAddr) -> [u8; 18] {
let mut result = [0; 18];
result[..16].copy_from_slice(&match saddr.ip() {
IpAddr::V4(ref ip) => &ip.to_ipv6_mapped(),
IpAddr::V6(ref ip) => ip,
}.octets());
IpAddr::V4(ref ip) => ip.to_ipv6_mapped().octets(),
IpAddr::V6(ref ip) => ip.octets(),
});
result[16..].copy_from_slice(&saddr.port().to_ne_bytes());
result
}