From 279183d718be256aac0a3db80ef382041b9755dc Mon Sep 17 00:00:00 2001 From: Thomas Coratger <60488569+tcoratger@users.noreply.github.com> Date: Mon, 3 Jun 2024 22:32:02 +0200 Subject: [PATCH] add a few more lints (#8574) --- Cargo.toml | 6 ++++++ crates/net/network/src/peers/manager.rs | 4 +--- crates/tracing/src/lib.rs | 2 +- 3 files changed, 8 insertions(+), 4 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index fc3093df5..bbfa6b379 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -163,6 +163,12 @@ string_lit_as_bytes = "warn" explicit_into_iter_loop = "warn" explicit_iter_loop = "warn" type_repetition_in_bounds = "warn" +manual_string_new = "warn" +naive_bytecount = "warn" +needless_bitwise_bool = "warn" +zero_sized_map_values = "warn" +single_char_pattern = "warn" +needless_continue = "warn" # These are nursery lints which have findings. Allow them for now. Some are not # quite mature enough for use in our codebase and some we don't really want. diff --git a/crates/net/network/src/peers/manager.rs b/crates/net/network/src/peers/manager.rs index d63f4414c..b362dc5ba 100644 --- a/crates/net/network/src/peers/manager.rs +++ b/crates/net/network/src/peers/manager.rs @@ -883,10 +883,8 @@ impl PeersManager { for peer_id in unbanned_peers { if let Some(peer) = self.peers.get_mut(&peer_id) { peer.unban(); - } else { - continue + self.queued_actions.push_back(PeerAction::UnBanPeer { peer_id }); } - self.queued_actions.push_back(PeerAction::UnBanPeer { peer_id }); } // clear the backoff list of expired backoffs, and mark the relevant peers as diff --git a/crates/tracing/src/lib.rs b/crates/tracing/src/lib.rs index 9d9f7eb30..4f8f7de42 100644 --- a/crates/tracing/src/lib.rs +++ b/crates/tracing/src/lib.rs @@ -159,7 +159,7 @@ impl Default for LayerInfo { Self { format: LogFormat::Terminal, default_directive: LevelFilter::INFO.to_string(), - filters: "".to_string(), + filters: String::new(), color: Some("always".to_string()), } }