Skip to content

Call BzDecoder::flush on finish #336

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

Open
wants to merge 7 commits into
base: main
Choose a base branch
from
Open
Changes from 6 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
11 changes: 9 additions & 2 deletions src/codec/bzip2/decoder.rs
Original file line number Diff line number Diff line change
Expand Up @@ -96,9 +96,16 @@
}

fn finish(
&mut self,

Check warning on line 99 in src/codec/bzip2/decoder.rs

View workflow job for this annotation

GitHub Actions / cargo fmt --check

Diff in /home/runner/work/async-compression/async-compression/src/codec/bzip2/decoder.rs
_output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>,
output: &mut PartialBuffer<impl AsRef<[u8]> + AsMut<[u8]>>,
) -> io::Result<bool> {
Ok(true)
match self.decode(
&mut PartialBuffer::new(&[][..]),
output,
)? {
Status::Ok => Ok(false),
Status::StreamEnd => Ok(true),
Status::BufError => Err(io::Error::other("unexpected BufError")),

Check failure on line 108 in src/codec/bzip2/decoder.rs

View workflow job for this annotation

GitHub Actions / cargo clippy

no variant or associated item named `BufError` found for enum `bzip2::Status` in the current scope

Check failure on line 108 in src/codec/bzip2/decoder.rs

View workflow job for this annotation

GitHub Actions / Build for wasm32-wasip1-threads

no variant or associated item named `BufError` found for enum `bzip2::Status` in the current scope

Check failure on line 108 in src/codec/bzip2/decoder.rs

View workflow job for this annotation

GitHub Actions / codecov

no variant or associated item named `BufError` found for enum `bzip2::Status` in the current scope

Check failure on line 108 in src/codec/bzip2/decoder.rs

View workflow job for this annotation

GitHub Actions / cargo test --shallow-minimal-versions

no variant or associated item named `BufError` found for enum `bzip2::Status` in the current scope

Check failure on line 108 in src/codec/bzip2/decoder.rs

View workflow job for this annotation

GitHub Actions / cargo test (stable, i686-unknown-linux-gnu, ubuntu-latest)

no variant or associated item named `BufError` found for enum `bzip2::Status` in the current scope

Check failure on line 108 in src/codec/bzip2/decoder.rs

View workflow job for this annotation

GitHub Actions / cargo test minimal-versions

no variant or associated item named `BufError` found for enum `bzip2::Status` in the current scope

Check failure on line 108 in src/codec/bzip2/decoder.rs

View workflow job for this annotation

GitHub Actions / cargo test (stable, x86_64-apple-darwin, macos-latest)

no variant or associated item named `BufError` found for enum `bzip2::Status` in the current scope

Check failure on line 108 in src/codec/bzip2/decoder.rs

View workflow job for this annotation

GitHub Actions / cargo test (stable, x86_64-unknown-linux-gnu, ubuntu-latest)

no variant or associated item named `BufError` found for enum `bzip2::Status` in the current scope

Check failure on line 108 in src/codec/bzip2/decoder.rs

View workflow job for this annotation

GitHub Actions / cargo test

no variant or associated item named `BufError` found for enum `bzip2::Status` in the current scope
}
}
}
Loading