Remove Score Ord, PartialOrd, Eq and PartialEq impls (#6420)

* drop score Ord, PartialOrd, Eq and PartialEq impls

and impl total_cmp instead

* Revert "Fix test failure on Rust v1.81 (#6407)"

This reverts commit 8a085fc828.

* reverse in the compare function

* lint mdfiles
This commit is contained in:
João Oliveira
2024-09-25 14:45:35 +01:00
committed by GitHub
parent 2792705331
commit 50d8375d46
4 changed files with 31 additions and 41 deletions

View File

@@ -2340,16 +2340,6 @@ mod tests {
gossipsub_score: f64,
}
// generate an arbitrary f64 while preventing NaN values
fn arbitrary_f64(g: &mut Gen) -> f64 {
loop {
let val = f64::arbitrary(g);
if !val.is_nan() {
return val;
}
}
}
impl Arbitrary for PeerCondition {
fn arbitrary(g: &mut Gen) -> Self {
let attestation_net_bitfield = {
@@ -2375,9 +2365,9 @@ mod tests {
outgoing: bool::arbitrary(g),
attestation_net_bitfield,
sync_committee_net_bitfield,
score: arbitrary_f64(g),
score: f64::arbitrary(g),
trusted: bool::arbitrary(g),
gossipsub_score: arbitrary_f64(g),
gossipsub_score: f64::arbitrary(g),
}
}
}