human-sort icon indicating copy to clipboard operation
human-sort copied to clipboard

Humansort implementation in rust

Results 5 human-sort issues
Sort by recently updated
recently updated
newest added

Closes #1 and #2. Also extends `sort` to accept any array of `T: AsRef`, in particular so that you can easily sort `Vec` without having to use `.sort_by(|a, b| compare(a,...

Currently, human-sort is case sensitive. This means that we need to call `to_lowercase` on the inputs if we want to sort while ignoring case, which wastes some time and needs...

These should both output `Less`: ```rust dbg!(human_sort::compare("x101", "x1000")); dbg!(human_sort::compare("x101", "x2000")); ``` But, ``` human_sort::compare("x101", "x1000") = Greater human_sort::compare("x101", "x2000") = Less ``` This happens because digits are consumed normally if...

Happens with human_sort 0.2.2 (140a09c9305e6d5e557e2ed7cbc68e05765a7d4213975b87cb04920689cc6219). To reproduce: ```rust fn main() { use human_sort::sort; let mut arr = [ "PowerTools/x86_64/os/repodata/9379911671413f8a51cd04665cd9bafc8200f927505008e8a11145034b53c776-other.xml.gz", "PowerTools/x86_64/os/repodata/43ed191200dbc7c83be76c3410f118f931bbe21ff6a58f5f549d0e351f3aea94-other.sqlite.xz", ]; sort(&mut arr); } ``` ``` $ env RUST_BACKTRACE=1 cargo...

The following code panics on Rust 1.81: ```rust fn main() { let mut x = [ "data_0_1_0.csv.zst", "data_12_1_0.csv.zst", "data_2_2_0.csv.zst", "data_4_1_0.csv.zst", "data_6_3_0.csv.zst", "data_9_1_0.csv.zst", "data_10_2_0.csv.zst", "data_12_2_0.csv.zst", "data_3_0_0.csv.zst", "data_4_2_0.csv.zst", "data_7_0_0.csv.zst", "data_11_0_0.csv.zst", "data_13_2_0.csv.zst", "data_3_1_0.csv.zst",...