Rust 1.84 lints (#6781)

* Fix few lints

* Fix remaining lints

* Use fully qualified syntax
This commit is contained in:
Pawan Dhananjay
2025-01-10 06:43:29 +05:30
committed by GitHub
parent 87b72dec21
commit 1f6850fae2
61 changed files with 110 additions and 138 deletions

View File

@@ -124,7 +124,7 @@ impl BackoffStorage {
pub(crate) fn is_backoff_with_slack(&self, topic: &TopicHash, peer: &PeerId) -> bool {
self.backoffs
.get(topic)
.map_or(false, |m| m.contains_key(peer))
.is_some_and(|m| m.contains_key(peer))
}
pub(crate) fn get_backoff_time(&self, topic: &TopicHash, peer: &PeerId) -> Option<Instant> {

View File

@@ -1770,8 +1770,7 @@ where
// reject messages claiming to be from ourselves but not locally published
let self_published = !self.config.allow_self_origin()
&& if let Some(own_id) = self.publish_config.get_own_id() {
own_id != propagation_source
&& raw_message.source.as_ref().map_or(false, |s| s == own_id)
own_id != propagation_source && raw_message.source.as_ref() == Some(own_id)
} else {
self.published_message_ids.contains(msg_id)
};