diff --git a/neqo-transport/src/connection/mod.rs b/neqo-transport/src/connection/mod.rs index bb05499091..2ff2f7cc26 100644 --- a/neqo-transport/src/connection/mod.rs +++ b/neqo-transport/src/connection/mod.rs @@ -2269,8 +2269,7 @@ impl Connection { let aead_expansion = tx.expansion(); builder.set_limit(profile.limit() - aead_expansion); builder.enable_padding(needs_padding); - let limit = builder.limit(); - debug_assert!(limit <= 2048); + debug_assert!(builder.limit() <= 2048); if builder.is_full() { encoder = builder.abort(); break; diff --git a/neqo-transport/src/packet/mod.rs b/neqo-transport/src/packet/mod.rs index 044df78761..dd1bc225c5 100644 --- a/neqo-transport/src/packet/mod.rs +++ b/neqo-transport/src/packet/mod.rs @@ -361,8 +361,7 @@ impl PacketBuilder { for v in values { self.encode_varint(*v); } - let limit = self.limit(); - debug_assert!(self.len() <= limit); + debug_assert!(self.len() <= self.limit()); }; write } diff --git a/neqo-transport/src/quic_datagrams.rs b/neqo-transport/src/quic_datagrams.rs index c73d659485..af82d8124e 100644 --- a/neqo-transport/src/quic_datagrams.rs +++ b/neqo-transport/src/quic_datagrams.rs @@ -121,8 +121,7 @@ impl QuicDatagrams { builder.encode(dgram.as_ref()); builder.mark_full(); } - let limit = builder.limit(); - debug_assert!(builder.len() <= limit); + debug_assert!(builder.len() <= builder.limit()); stats.frame_tx.datagram += 1; tokens.push(RecoveryToken::Datagram(*dgram.tracking())); } else if tokens.is_empty() { diff --git a/neqo-transport/src/send_stream.rs b/neqo-transport/src/send_stream.rs index 2d907cf7a7..cf21ff9fa8 100644 --- a/neqo-transport/src/send_stream.rs +++ b/neqo-transport/src/send_stream.rs @@ -994,8 +994,7 @@ impl SendStream { } else { builder.encode_vvec(&data[..length]); } - let limit = builder.limit(); - debug_assert!(builder.len() <= limit); + debug_assert!(builder.len() <= builder.limit()); self.mark_as_sent(offset, length, fin); tokens.push(RecoveryToken::Stream(StreamRecoveryToken::Stream(