diff --git a/Cargo.toml b/Cargo.toml index afba35e..9290f9e 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -73,6 +73,7 @@ temptree = "0.2.0" [lints.clippy] all = { level = "deny", priority = -1 } float_cmp = "allow" +ignore_without_reason = "allow" large_enum_variant = "allow" needless_pass_by_value = "allow" pedantic = { level = "deny", priority = -1 } diff --git a/src/peer/client.rs b/src/peer/client.rs index 5c419a1..8d0ff30 100644 --- a/src/peer/client.rs +++ b/src/peer/client.rs @@ -251,7 +251,10 @@ impl Client { seeder.handle_msg(&msg).unwrap(); let mut pieces = info_dict.len() / extended::UtMetadata::PIECE_LENGTH; - if info_dict.len() % extended::UtMetadata::PIECE_LENGTH > 0 { + if !info_dict + .len() + .is_multiple_of(extended::UtMetadata::PIECE_LENGTH) + { pieces += 1; } diff --git a/src/subcommand/torrent/stats.rs b/src/subcommand/torrent/stats.rs index 22188ea..93ed2fc 100644 --- a/src/subcommand/torrent/stats.rs +++ b/src/subcommand/torrent/stats.rs @@ -152,7 +152,7 @@ impl Extractor { return; } - if self.torrents % 10000 == 0 { + if self.torrents.is_multiple_of(10000) { eprintln!("Processing torrent {}...", self.torrents); }