feat(ci): lint against usages of variables with underscore

Prefixing a variable with an underscore (`_`) in Rust indicates that it is not used. Through refactorings, it can sometimes happen that we do end up using such a variable. In this case, the underscore should be removed.

Clippy can help us with this.

Pull-Request: #3484.
This commit is contained in:
Thomas Eizinger
2023-02-24 19:34:59 +11:00
committed by GitHub
parent 6383e1e8bd
commit d80d92dc45
10 changed files with 90 additions and 65 deletions

View File

@ -563,7 +563,7 @@ impl PeerScore {
}
}
pub fn validate_message(&mut self, _from: &PeerId, msg_id: &MessageId, topic_hash: &TopicHash) {
pub fn validate_message(&mut self, from: &PeerId, msg_id: &MessageId, topic_hash: &TopicHash) {
// adds an empty record with the message id
self.deliveries
.entry(msg_id.clone())
@ -572,12 +572,12 @@ impl PeerScore {
if let Some(callback) = self.message_delivery_time_callback {
if self
.peer_stats
.get(_from)
.get(from)
.and_then(|s| s.topics.get(topic_hash))
.map(|ts| ts.in_mesh())
.unwrap_or(false)
{
callback(_from, topic_hash, 0.0);
callback(from, topic_hash, 0.0);
}
}
}