Skip to content

Commit

Permalink
Rework match expression
Browse files Browse the repository at this point in the history
To avoid unused_io_amount clippy lint. It ends up doing the same thing,
but since we are no longer using a match guard, the compiler can tell
that coverage is exhaustive.
  • Loading branch information
dmartin committed Apr 2, 2024
1 parent b879e07 commit ad9e400
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,10 +106,10 @@ fn get_tarball_checksum(tarball: &Path) -> Result<Vec<u8>, std::io::Error> {
loop {
// Avoid reading all of tarball into memory at once
match tarball.read(&mut buf) {
Ok(n) if n > 0 => {
Ok(n @ 1..) => {
hasher.update(&buf[..n]);
}
Ok(_) => break,
Ok(0) => break,
Err(e) => return Err(e),
}
}
Expand Down

0 comments on commit ad9e400

Please sign in to comment.