We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
1 parent 9caefff commit b42f850Copy full SHA for b42f850
tokio-imap/src/proto.rs
@@ -1,4 +1,4 @@
1
-use bytes::{BufMut, BytesMut};
+use bytes::{BufMut, Bytes, BytesMut};
2
3
use futures;
4
@@ -56,7 +56,7 @@ impl<'a> Decoder for ImapCodec {
56
));
57
},
58
};
59
- let raw = buf.split_to(rsp_len);
+ let raw = buf.split_to(rsp_len).freeze();
60
self.decode_need_message_bytes = 0;
61
Ok(Some(ResponseData { raw, response }))
62
}
@@ -76,7 +76,7 @@ impl Encoder for ImapCodec {
76
77
#[derive(Debug)]
78
pub struct ResponseData {
79
- raw: BytesMut,
+ raw: Bytes,
80
// This reference is really scoped to the lifetime of the `raw`
81
// member, but unfortunately Rust does not allow that yet. It
82
// is transmuted to `'static` by the `Decoder`, instead, and
0 commit comments