Skip to content

Commit 293a478

Browse files
authored
Fix clippy lints (#551)
1 parent e6c982a commit 293a478

3 files changed

Lines changed: 6 additions & 2 deletions

File tree

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -73,6 +73,7 @@ temptree = "0.2.0"
7373
[lints.clippy]
7474
all = { level = "deny", priority = -1 }
7575
float_cmp = "allow"
76+
ignore_without_reason = "allow"
7677
large_enum_variant = "allow"
7778
needless_pass_by_value = "allow"
7879
pedantic = { level = "deny", priority = -1 }

src/peer/client.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -251,7 +251,10 @@ impl Client {
251251
seeder.handle_msg(&msg).unwrap();
252252

253253
let mut pieces = info_dict.len() / extended::UtMetadata::PIECE_LENGTH;
254-
if info_dict.len() % extended::UtMetadata::PIECE_LENGTH > 0 {
254+
if !info_dict
255+
.len()
256+
.is_multiple_of(extended::UtMetadata::PIECE_LENGTH)
257+
{
255258
pieces += 1;
256259
}
257260

src/subcommand/torrent/stats.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -152,7 +152,7 @@ impl Extractor {
152152
return;
153153
}
154154

155-
if self.torrents % 10000 == 0 {
155+
if self.torrents.is_multiple_of(10000) {
156156
eprintln!("Processing torrent {}...", self.torrents);
157157
}
158158

0 commit comments

Comments
 (0)