diff --git a/crates/net/eth-wire/src/ethstream.rs b/crates/net/eth-wire/src/ethstream.rs index 212fd8e46..224e848bb 100644 --- a/crates/net/eth-wire/src/ethstream.rs +++ b/crates/net/eth-wire/src/ethstream.rs @@ -257,7 +257,7 @@ where /// Sends a raw capability message directly over the stream pub fn start_send_raw(&mut self, msg: RawCapabilityMessage) -> Result<(), EthStreamError> { - let mut bytes = Vec::new(); + let mut bytes = Vec::with_capacity(msg.payload.len() + 1); msg.id.encode(&mut bytes); bytes.extend_from_slice(&msg.payload);