unwrap-ord 0.1.3

Wrapper type to easily convert Ord to PartialOrd. inspired by std::cmp::Reverse
Documentation
  • Coverage
  • 0%
    0 out of 3 items documented0 out of 1 items with examples
  • Size
  • Source code size: 4.16 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 386.77 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • higumachan/unwrap-ord
    0 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • higumachan

unwrap-ord

Crates.io

Wrapper type to easily convert Ord to PartialOrd. inspired by std::cmp::Reverse

How to use

Add your Cargo.toml

unwrap-ord = "0.1.0"
use unwrap_ord::UnwrapOrd;

fn main() {
    let v = [1.0, 3.0, 2.0];
    let mut v: Vec<_> = v.iter().copied().map(|x| UnwrapOrd(x)).collect();

    v.sort();

    println!("{:?}", v);  // [UncheckOrd(1.0), UncheckOrd(2.0), UncheckOrd(3.0)]
}