Skip to content

Commit 03627df

Browse files
committed
refactor(decompression-plz): clippy lint
1 parent 4459a6d commit 03627df

File tree

5 files changed

+6
-10
lines changed

5 files changed

+6
-10
lines changed

decompression-plz/src/decode_struct.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ use header_plz::body_headers::encoding_info::EncodingInfo;
55
use header_plz::body_headers::transfer_types::TransferType;
66

77
use crate::chunked::chunked_to_raw;
8-
use crate::content_length::{add_body_and_update_cl, update_content_length};
8+
use crate::content_length::add_body_and_update_cl;
99
use crate::decompress_trait::DecompressTrait;
1010

1111
#[cfg_attr(test, derive(PartialEq))]
@@ -46,12 +46,12 @@ where
4646
self.body_headers
4747
.as_ref()
4848
.and_then(|bh| bh.transfer_type.as_ref())
49-
.and_then(|tt| Some(tt == &TransferType::Chunked))
49+
.map(|tt| tt == &TransferType::Chunked)
5050
.unwrap_or(false)
5151
}
5252

5353
pub fn chunked_to_raw(&mut self) {
54-
chunked_to_raw(self.message, &mut self.buf);
54+
chunked_to_raw(self.message, self.buf);
5555
self.body = self.message.get_body().into_bytes().unwrap();
5656
}
5757

decompression-plz/src/decompression/dstruct.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -179,7 +179,7 @@ impl<'a> DecompressionStruct<'a> {
179179
if e.is_corrupt() {
180180
let (header_index, compression_index) =
181181
self.last_header_compression_index();
182-
e.from_corrupt_to_partial(
182+
e.corrupt_to_partial(
183183
input,
184184
header_index,
185185
compression_index,
@@ -199,7 +199,6 @@ mod tests {
199199
use tests_utils::*;
200200

201201
use crate::decompression::multi::error::MultiDecompressErrorReason;
202-
use crate::decompression::single::error::DecompressError;
203202

204203
use super::*;
205204

decompression-plz/src/decompression/multi/error.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -32,7 +32,7 @@ impl MultiDecompressError {
3232
matches!(self.error, DecompressError::Unknown(_))
3333
}
3434

35-
pub fn from_corrupt_to_partial(
35+
pub fn corrupt_to_partial(
3636
mut self,
3737
partial_body: BytesMut,
3838
header_index: usize,

decompression-plz/src/lib.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,3 @@
1-
#![allow(warnings, unused)]
2-
31
use bytes::BytesMut;
42

53
use crate::state::DecodeState;

decompression-plz/src/state.rs

Lines changed: 1 addition & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3,7 +3,6 @@ use std::cmp::Ordering;
33
use body_plz::variants::Body;
44
use bytes::BytesMut;
55
use header_plz::body_headers::encoding_info::EncodingInfo;
6-
use tracing::error;
76

87
use crate::{
98
decode_struct::DecodeStruct,
@@ -44,7 +43,7 @@ where
4443
} else if decode_struct.extra_body_is_some() {
4544
Self::UpdateContentLength(decode_struct)
4645
} else {
47-
let mut body = decode_struct.take_main_body();
46+
let body = decode_struct.take_main_body();
4847
decode_struct.message.set_body(Body::Raw(body));
4948
Self::End
5049
};

0 commit comments

Comments
 (0)