diff options
| author | MaxVerevkin <maxxverrr@gmail.com> | 2023-03-31 00:27:47 +0300 |
|---|---|---|
| committer | MaxVerevkin <maxxverrr@gmail.com> | 2023-03-31 00:27:47 +0300 |
| commit | 4d23983c1f048c2301bf464ba949d578b98d4426 (patch) | |
| tree | b4233e7fdac2ef822f02f28e8bf87e81b5779026 /src/ord_adaptor.rs | |
| parent | cd1d6fd18cf868dc59e51a34679257d98a9114b7 (diff) | |
| download | i3bar-mango-4d23983c1f048c2301bf464ba949d578b98d4426.tar.gz | |
refactor progressive short-text switching
Diffstat (limited to 'src/ord_adaptor.rs')
| -rw-r--r-- | src/ord_adaptor.rs | 18 |
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) - } -} |
