Fix: clippy warning in rust 1.66.0

This commit is contained in:
Bo Zhang
2022-08-02 15:52:01 +08:00
committed by dlhxzb
parent d7b2060a5b
commit 60a6d672c5
18 changed files with 355 additions and 409 deletions

View File

@@ -15,6 +15,12 @@ enum DecodeState {
Data(usize),
}
impl Default for BytesCodec {
fn default() -> Self {
Self::new()
}
}
impl BytesCodec {
pub fn new() -> Self {
Self {
@@ -56,7 +62,7 @@ impl BytesCodec {
}
src.advance(head_len);
src.reserve(n);
return Ok(Some(n));
Ok(Some(n))
}
fn decode_data(&self, n: usize, src: &mut BytesMut) -> io::Result<Option<BytesMut>> {