Skip to content

Commit

Permalink
Remove unnecessary trait implementations
Browse files Browse the repository at this point in the history
  • Loading branch information
thomaseizinger committed Dec 30, 2023
1 parent 3719440 commit 7b6d354
Showing 1 changed file with 1 addition and 21 deletions.
22 changes: 1 addition & 21 deletions protocols/autonat/src/v2/client/behaviour.rs
Original file line number Diff line number Diff line change
Expand Up @@ -321,7 +321,7 @@ where
.map(|(addr, count)| (addr.clone(), *count))
.collect::<Vec<_>>();

entries.sort_unstable_by_key(|(_, count)| *count);
entries.sort_unstable_by_key(|(_, info)| info.score);

if entries.is_empty() {
tracing::debug!("No untested address candidates");
Expand Down Expand Up @@ -420,23 +420,3 @@ struct AddressInfo {
score: usize,
is_tested: bool,
}

impl PartialOrd for AddressInfo {
fn partial_cmp(&self, other: &Self) -> Option<std::cmp::Ordering> {
Some(self.score.cmp(&other.score))
}
}

impl PartialEq for AddressInfo {
fn eq(&self, other: &Self) -> bool {
self.score == other.score
}
}

impl Ord for AddressInfo {
fn cmp(&self, other: &Self) -> std::cmp::Ordering {
self.score.cmp(&other.score)
}
}

impl Eq for AddressInfo {}

0 comments on commit 7b6d354

Please sign in to comment.