10 stable releases

Uses old Rust 2015

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

#280 in Algorithms

Download history 27546/week @ 2024-06-09 26630/week @ 2024-06-16 27455/week @ 2024-06-23 25161/week @ 2024-06-30 27015/week @ 2024-07-07 31953/week @ 2024-07-14 30961/week @ 2024-07-21 32419/week @ 2024-07-28 30904/week @ 2024-08-04 32440/week @ 2024-08-11 29493/week @ 2024-08-18 26718/week @ 2024-08-25 27360/week @ 2024-09-01 23503/week @ 2024-09-08 23884/week @ 2024-09-15 27780/week @ 2024-09-22

104,113 downloads per month
Used in 95 crates (36 directly)

MIT license

10KB
170 lines

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.

No runtime deps