Skip to content

Commit

Permalink
Fix merge issues
Browse files Browse the repository at this point in the history
  • Loading branch information
gyscos committed Jul 5, 2024
1 parent 6688207 commit 6ad8559
Showing 1 changed file with 10 additions and 12 deletions.
22 changes: 10 additions & 12 deletions src/stream/raw.rs
Original file line number Diff line number Diff line change
Expand Up @@ -179,17 +179,15 @@ impl<'a> Decoder<'a> {
}

/// Creates a new decoder, using a ref prefix
pub fn with_ref_prefix<'b>(
ref_prefix: &'b [u8],
) -> io::Result<Self>
pub fn with_ref_prefix<'b>(ref_prefix: &'b [u8]) -> io::Result<Self>
where
'b: 'a,
{
let mut context = zstd_safe::DCtx::create();
context
.ref_prefix(ref_prefix)
.map_err(map_error_code)?;
Ok(Decoder { context })
context.ref_prefix(ref_prefix).map_err(map_error_code)?;
Ok(Decoder {
context: MaybeOwnedDCtx::Owned(context),
})
}

/// Sets a decompression parameter for this decoder.
Expand Down Expand Up @@ -318,7 +316,7 @@ impl<'a> Encoder<'a> {
/// Creates a new encoder initialized with the given ref prefix.
pub fn with_ref_prefix<'b>(
level: i32,
ref_prefix: &'b [u8]
ref_prefix: &'b [u8],
) -> io::Result<Self>
where
'b: 'a,
Expand All @@ -329,11 +327,11 @@ impl<'a> Encoder<'a> {
.set_parameter(CParameter::CompressionLevel(level))
.map_err(map_error_code)?;

context
.ref_prefix(ref_prefix)
.map_err(map_error_code)?;
context.ref_prefix(ref_prefix).map_err(map_error_code)?;

Ok(Encoder { context })
Ok(Encoder {
context: MaybeOwnedCCtx::Owned(context),
})
}

/// Sets a compression parameter for this encoder.
Expand Down

0 comments on commit 6ad8559

Please sign in to comment.