Skip to content

Commit 33a2dbe

Browse files
committed
feat(decompression-plz): implemented DecodeStruct to hold mutable reference to DecompressTrait
1 parent 3bf3d80 commit 33a2dbe

File tree

2 files changed

+6
-6
lines changed

2 files changed

+6
-6
lines changed

decompression-plz/src/decode_struct.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -4,11 +4,11 @@ use header_plz::body_headers::content_encoding::ContentEncoding;
44
use header_plz::body_headers::encoding_info::EncodingInfo;
55

66
use crate::decompression::multi::error::MultiDecompressError;
7-
use crate::decompression::state::runner;
7+
use crate::decompression::state::decompression_runner;
88
use crate::dtraits::DecompressTrait;
99

1010
pub struct DecodeStruct<'a, T> {
11-
pub message: T,
11+
pub message: &'a mut T,
1212
pub body: BytesMut,
1313
pub extra_body: Option<BytesMut>,
1414
body_headers: Option<BodyHeader>,
@@ -20,7 +20,7 @@ where
2020
T: DecompressTrait,
2121
{
2222
pub fn new(
23-
mut message: T,
23+
mut message: &'a mut T,
2424
mut extra_body: Option<BytesMut>,
2525
buf: &'a mut BytesMut,
2626
) -> Self {

decompression-plz/src/state.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -9,7 +9,7 @@ use crate::{
99
decode_struct::DecodeStruct,
1010
decompression::{
1111
multi::error::{MultiDecompressError, MultiDecompressErrorReason},
12-
state::runner,
12+
state::decompression_runner,
1313
},
1414
dtraits::DecompressTrait,
1515
};
@@ -26,8 +26,8 @@ impl<'a, T> DecodeState<'a, T>
2626
where
2727
T: DecompressTrait + 'a,
2828
{
29-
fn init(
30-
mut message: T,
29+
pub fn init(
30+
message: &'a mut T,
3131
mut extra_body: Option<BytesMut>,
3232
buf: &'a mut BytesMut,
3333
) -> Self {

0 commit comments

Comments
 (0)