10 stable releases
|1.0.9||Aug 24, 2015|
|1.0.8||Mar 12, 2015|
|1.0.7||Jan 29, 2015|
|1.0.1||Dec 24, 2014|
|1.0.0||Nov 21, 2014|
#108 in Algorithms
14,512 downloads per month
Used in 9 crates (7 directly)
Natural ordering for Rust. (also known as
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_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
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.