Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Add into_inner() to FrameDecoder #56

Merged
merged 3 commits into from
Sep 3, 2022
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,7 @@ homepage = "https://github.com/pseitz/lz4_flex"
repository = "https://github.com/pseitz/lz4_flex"
readme = "README.md"
license = "MIT"
version = "0.9.4"
version = "0.9.5"
include = ["src/*.rs", "src/frame/**/*", "src/block/**/*", "README.md"]

[[bench]]
Expand Down
2 changes: 1 addition & 1 deletion src/frame/compress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -151,7 +151,7 @@ impl<W: io::Write> FrameEncoder<W> {
}

/// Returns the underlying writer _without_ flushing the stream.
/// This may lave the output in an unfinished state.
/// This may leave the output in an unfinished state.
pub fn into_inner(self) -> W {
self.w
}
Expand Down
5 changes: 5 additions & 0 deletions src/frame/decompress.rs
Original file line number Diff line number Diff line change
Expand Up @@ -102,6 +102,11 @@ impl<R: io::Read> FrameDecoder<R> {
&mut self.r
}

/// Consumes the FrameDecoder and returns the underlying reader.
pub fn into_inner(self) -> R {
self.r
}

fn read_frame_info(&mut self) -> Result<usize, io::Error> {
let mut buffer = [0u8; MAX_FRAME_INFO_SIZE];
match self.r.read(&mut buffer[..MIN_FRAME_INFO_SIZE])? {
Expand Down