Skip to content

Releases: Aloso/lexical-sort

Release 0.3.1

29 Aug 23:33
Compare
Choose a tag to compare

This small release adds no_std support. There's a std feature that is required for comparing and sorting file paths. This feature is enabled by default, so you need to disable default features to compile without the standard library:

# Cargo.toml

[dependencies]
lexical-sort = { version = "0.3.1", default-features = false }

Release 0.3

20 Jun 22:13
Compare
Choose a tag to compare

This release features three new comparison functions and a brand new public API that is more powerful and flexible. Additionally, the benchmark was rewritten and the documentation was improved.

The new API

There are now two traits, StringSort and PathSort, which allow sorting a slice containing strings or paths, or things that implement AsRef<str> or AsRef<Path>:

use lexical_sort::{StringSort, natural_lexical_cmp};

let mut strings = vec!["ß", "é", "100", "hello", "world", "50", ".", "B!"];
strings.string_sort_unstable(natural_lexical_cmp);

Comparison functions

There are now 8 comparison functions available:

Function lexico­graphical natural skips non-alphanumeric chars
cmp
only_alnum_cmp yes
lexical_cmp yes
lexical_only_alnum_cmp yes yes
natural_cmp yes
natural_only_alnum_cmp yes yes
natural_lexical_cmp yes yes
natural_lexical_­only_alnum_cmp yes yes yes

Looking ahead

I plan to implement better Unicode support, although I still have to explore the design space here. I'm also open to feature requests!

Version 0.2.1

19 Jun 13:33
Compare
Choose a tag to compare

This is a new release of the lexical-sort crate with a bug fix to sort numbers correctly, more benchmarks, and two new functions: lexical_cmp_only_alnum and lexical_natural_cmp_only_alnum skip characters that aren't alphanumeric.

Version 0.2

15 Jun 23:02
Compare
Choose a tag to compare

This is a new release of the lexical-sort crate with performance improvements, better Unicode support thanks to the any_ascii crate, a benchmark and a new license.

Version 0.1

15 Jun 03:12
Compare
Choose a tag to compare
v0.1

Remove keywords