Packages / rupm

rs-collections-natural-sort 0.1.0

Natural ordering so file2 sorts before file10

Install

cargo add rs-collections-natural-sort --registry rupm

In Ruststudio: Packages, search for rs-collections-natural-sort, Install.

Owner: Rust Studio. Licence: MIT OR Apache-2.0. Total downloads: 0. Published 2026-11-23.

Versions

README

# rs-collections-natural-sort

Natural ordering so file2 sorts before file10

Add it with `rupm add rs-collections-natural-sort` (or `cargo add rs-collections-natural-sort --registry rupm`).

```rust
let mut v = vec!["file10", "file2", "file1"];
v.sort_by(|a, b| rs_collections_natural_sort::compare(a, b));
assert_eq!(v, vec!["file1", "file2", "file10"]);
```