refactor election score (#10834)

* refactor election score

* Test for ord

* remove reference

* vec -> slice

* change iter to iter_by_significance

* improve doc

* fix typo

* add explanation about [u128; 3]

* consolidate threshold and epsilon

* random fixes

* rename

* remove Into

* make iter_by_sig private

* remove vec

* Fix tests
This commit is contained in:
Kian Paimani authored and GitHub committed 2022-02-16 10:40:16 +00:00
1 parent 9d8e5639d5
commit 6b7eb2e2d7
9 files changed
+281 -124

No files matched your search

+1 -1
View File
@@ -55,7 +55,7 @@ use traits::{BaseArithmetic, One, SaturatedConversion, Unsigned, Zero};
/// - `Ordering::Equal` otherwise.
pub trait ThresholdOrd<T> {
/// Compare if `self` is `threshold` greater or less than `other`.
fn tcmp(&self, other: &T, epsilon: T) -> Ordering;
fn tcmp(&self, other: &T, threshold: T) -> Ordering;
}
impl<T> ThresholdOrd<T> for T