diff --git a/transports/noise/src/io/framed.rs b/transports/noise/src/io/framed.rs index 2b66e80cb72..f41b4110b7b 100644 --- a/transports/noise/src/io/framed.rs +++ b/transports/noise/src/io/framed.rs @@ -57,7 +57,7 @@ impl Codec { } } - fn encode_bytes(&mut self, item: &[u8], dst: &mut BytesMut) -> Result<(), io::Error> { + fn encode_bytes(&mut self, item: &Vec, dst: &mut BytesMut) -> Result<(), io::Error> { self.encrypt_buffer .resize(item.len() + EXTRA_ENCRYPT_SPACE, 0); let n = match self.session.write_message(item, &mut self.encrypt_buffer) { @@ -179,7 +179,7 @@ impl asynchronous_codec::Decoder for Codec { impl asynchronous_codec::Encoder for Codec { type Error = io::Error; - type Item<'a> = &'a [u8]; + type Item<'a> = &'a Vec; fn encode(&mut self, item: Self::Item<'_>, dst: &mut BytesMut) -> Result<(), Self::Error> { self.encode_bytes(item, dst)