natord-plus-plus 2.0.0

Natural ordering for Rust
Documentation
  • Coverage
  • 100%
    4 out of 4 items documented1 out of 4 items with examples
  • Size
  • Source code size: 11.38 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 270.76 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Links
  • Homepage
  • Documentation
  • lifthrasiir/rust-natord
    26 3 1
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • cafkafk

Natord 1.0.9

Natord on Travis CI

Natural ordering for Rust. (also known as rust-natord) This allows for the comparison like this:

let mut files = vec!("rfc2086.txt", "rfc822.txt", "rfc1.txt");
files.sort_by(|&a, &b| natord::compare(a, b));
assert_eq!(files, ["rfc1.txt", "rfc822.txt", "rfc2086.txt"]);

It provides a compare and compare_ignore_case function for comparing strings, and also a compare_iter function for the customizable algorithm.

There are multiple natural ordering algorithms available. This version of natural ordering is inspired by Martin Pool's strnatcmp.c. See the test cases in the source code to see what it can do and it cannot.

Natord is written by Kang Seonghoon and licensed under the MIT/X11 license.