Include room for SocketAddrV6 to serialize scope id

https://github.com/rust-lang/rust/pull/77426
This commit is contained in:
David Tolnay 2020-10-02 18:25:44 -07:00
parent be7d0e7eb2
commit 2b504099e4
No known key found for this signature in database
GPG Key ID: F9BA143B95FF6D82

View File

@ -753,10 +753,10 @@ impl Serialize for net::SocketAddrV6 {
S: Serializer,
{
if serializer.is_human_readable() {
const MAX_LEN: usize = 47;
const MAX_LEN: usize = 58;
debug_assert_eq!(
MAX_LEN,
"[1001:1002:1003:1004:1005:1006:1007:1008]:65000".len()
"[1001:1002:1003:1004:1005:1006:1007:1008%4294967295]:65000".len()
);
serialize_display_bounded_length!(self, MAX_LEN, serializer)
} else {