Skip to content

Switch to numeric-sort #1758

@mre

Description

@mre

human-sort is unmaintained.

It's also broken in recent Rust versions. I found out when checking a bunch of links:

 lychee links.txt
  178/178 ━━━━━━━━━━━━━━━━━━━━ Finished extracting links
thread 'main' panicked at library/core/src/slice/sort/shared/smallsort.rs:860:5:
user-provided comparison function does not correctly implement a total order
note: run with `RUST_BACKTRACE=1` environment variable to display a backtrace
❯❯❯ RUST_BACKTRACE=1 lychee links.txt
  178/178 ━━━━━━━━━━━━━━━━━━━━ Finished extracting links
thread 'main' panicked at library/core/src/slice/sort/shared/smallsort.rs:860:5:
user-provided comparison function does not correctly implement a total order
stack backtrace:
   0: __rustc::rust_begin_unwind
   1: core::panicking::panic_fmt
   2: core::slice::sort::shared::smallsort::panic_on_ord_violation
   3: core::slice::sort::shared::smallsort::sort8_stable
   4: core::slice::sort::stable::quicksort::quicksort
   5: core::slice::sort::stable::drift::sort
   6: core::slice::sort::stable::driftsort_main
   7: <core::iter::adapters::map::Map<I,F> as core::iter::traits::iterator::Iterator>::next
   8: <alloc::vec::Vec<T> as alloc::vec::spec_from_iter::SpecFromIter<T,I>>::from_iter
   9: lychee::formatters::stats::sort_stat_map
  10: <lychee::formatters::stats::compact::Compact as lychee::formatters::stats::StatsFormatter>::format
  11: lychee::run::{{closure}}
  12: tokio::runtime::park::CachedParkThread::block_on
  13: tokio::runtime::runtime::Runtime::block_on
  14: lychee::main
note: Some details are omitted, run with `RUST_BACKTRACE=full` for a verbose backtrace.
/t/fuzz ❯❯❯

The issue is described here.

We should switch to numeric-sort instead. Pull requests welcome!

Metadata

Metadata

Assignees

No one assigned

    Labels

    bugSomething isn't workingdependenciesPull requests that update a dependency filedeprecationgood first issueGood for newcomershelp wantedExtra attention is needed

    Type

    No fields configured for Bug.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions