summaryrefslogtreecommitdiff
path: root/src/ord_adaptor.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/ord_adaptor.rs')
-rw-r--r--src/ord_adaptor.rs18
1 files changed, 0 insertions, 18 deletions
diff --git a/src/ord_adaptor.rs b/src/ord_adaptor.rs
deleted file mode 100644
index c7c6763..0000000
--- a/src/ord_adaptor.rs
+++ /dev/null
@@ -1,18 +0,0 @@
-//! Newtypes to use floating numbers in sorting algs
-
-use std::cmp::Ordering;
-
-/// Defaults to `Ordering::Less` if the wrapped value can't be compared
-#[derive(PartialEq, PartialOrd)]
-#[repr(transparent)]
-pub struct DefaultLess<T: PartialOrd>(pub T);
-
-// Not ideal, but `Ord` requires `Eq`, so...
-impl<T: PartialOrd> Eq for DefaultLess<T> {}
-
-#[allow(clippy::derive_ord_xor_partial_ord)]
-impl<T: PartialOrd> Ord for DefaultLess<T> {
- fn cmp(&self, other: &Self) -> Ordering {
- self.partial_cmp(other).unwrap_or(Ordering::Less)
- }
-}