Fix clippy lints related to recent bug

This commit is contained in:
Igor Katson 2024-04-24 14:19:04 +01:00
parent 5dee78227b
commit 3d46d7cb97
No known key found for this signature in database
GPG key ID: B4EC22B66D61A3F5
13 changed files with 89 additions and 78 deletions

View file

@ -247,7 +247,7 @@ impl Lengths {
if chunk_index == last_chunk_id {
return Some(last_element_size(piece_length, CHUNK_SIZE));
}
return None;
None
}
// How many bytes out of the given piece are present in the given file (by offset and len).
@ -558,7 +558,7 @@ mod tests {
// A few more examples with longer values and weird inputs.
let l = Lengths::new(16384_1_1, 16384_1).unwrap();
let l = Lengths::new(1_638_411, 163_841).unwrap();
assert_eq!(l.default_chunks_per_piece(), 11);
assert_eq!(l.total_pieces(), 11);
assert_eq!(l.total_chunks(), 111);