Skip to content

Commit

Permalink
fix clippy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
KillingSpark committed Jul 4, 2022
1 parent 261e43b commit 9c13993
Showing 1 changed file with 5 additions and 4 deletions.
9 changes: 5 additions & 4 deletions src/decoding/decodebuffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -257,17 +257,18 @@ impl Decodebuffer {
self.hash.write(&slice1[..written1]);
drain_guard.amount += written1;

// Shut clippy up. I liked the explicit if better but oh well...
let _: () = res1?;
// Apparently this is what clippy thinks is the best way of expressing this
res1?;

// Only if the first call to write_bytes was not a partial write we can continue with slice2
// Partial writes SHOULD never happen without res1 being an error, but lets just protect against it anyways.
if written1 == n1 && n2 != 0 {
let (written2, res2) = write_bytes(&slice2[..n2]);
self.hash.write(&slice2[..written2]);
drain_guard.amount += written2;
// Shut clippy up. I liked the explicit if better but oh well...
let _: () = res2?;

// Apparently this is what clippy thinks is the best way of expressing this
res2?;
}
}

Expand Down

0 comments on commit 9c13993

Please sign in to comment.