Skip to content

Commit

Permalink
snappy: propage error instead of using unwrap
Browse files Browse the repository at this point in the history
 though very unlikely to panic, use ? operator
  • Loading branch information
jqnatividad committed May 20, 2023
1 parent f1b44ba commit a2f3822
Showing 1 changed file with 2 additions and 4 deletions.
6 changes: 2 additions & 4 deletions src/cmd/snappy.rs
Original file line number Diff line number Diff line change
Expand Up @@ -198,10 +198,8 @@ pub fn run(argv: &[&str]) -> CliResult<()> {
// multi-threaded streaming snappy compression
fn compress<R: Read, W: Write + Send + 'static>(mut src: R, dst: W, jobs: usize) -> CliResult<()> {
let mut writer = ParCompressBuilder::<Snap>::new()
.num_threads(jobs)
.unwrap()
.buffer_size(gzp::BUFSIZE)
.unwrap()
.num_threads(jobs)?
.buffer_size(gzp::BUFSIZE)?
.pin_threads(Some(0))
.from_writer(dst);
io::copy(&mut src, &mut writer)?;
Expand Down

0 comments on commit a2f3822

Please sign in to comment.