Fix Edge Cases
Closes #1 and #2. Also extends sort to accept any array of T: AsRef<str>, in particular so that you can easily sort Vec<String> without having to use .sort_by(|a, b| compare(a, b)).
Breaking change: compare_chars_iters now returns Ordering instead of Result<Ordering, ()>. Err was returned if every loop iteration found no difference, but if we handle the (Some(_), None) and (None, Some(_)) cases there's no issue determining the result inside the function.
This also fixes a bug where we were implicitly expecting base 10 digits, but were using char::is_numeric which is any number-like unicode character, including fraction characters, etc. It now uses char::is_digit.
is there any reason why this has not been merged?
@horacimacias not that I know of. tbh it was taking so long I just ended up making my own crate that includes these fixes (not a drop in replacement, but very similar): https://crates.io/crates/numeric-sort
awesome, thanks!