diff --git a/Cargo.lock b/Cargo.lock index 85f888065d..c92f7d4198 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -1906,12 +1906,6 @@ version = "1.0.3" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "df3b46402a9d5adb4c86a0cf463f42e19994e3ee891101b1841f30a545cb49a9" -[[package]] -name = "human-sort" -version = "0.2.2" -source = "registry+https://github.com/rust-lang/crates.io-index" -checksum = "140a09c9305e6d5e557e2ed7cbc68e05765a7d4213975b87cb04920689cc6219" - [[package]] name = "humantime" version = "2.2.0" @@ -2506,12 +2500,12 @@ dependencies = [ "headers", "http 1.3.1", "http-serde", - "human-sort", "humantime", "humantime-serde", "indicatif", "log", "lychee-lib", + "numeric-sort", "openssl-sys", "pad", "predicates", @@ -2786,6 +2780,12 @@ version = "0.4.0" source = "registry+https://github.com/rust-lang/crates.io-index" checksum = "830b246a0e5f20af87141b25c173cd1b609bd7779a4617d6ec582abaf90870f3" +[[package]] +name = "numeric-sort" +version = "0.1.5" +source = "registry+https://github.com/rust-lang/crates.io-index" +checksum = "f2dcb6053ab98da45585315f79932c5c9821fab8efa4301c0d7b637c91630eb7" + [[package]] name = "object" version = "0.36.7" diff --git a/lychee-bin/Cargo.toml b/lychee-bin/Cargo.toml index e68ac06909..35a0894fac 100644 --- a/lychee-bin/Cargo.toml +++ b/lychee-bin/Cargo.toml @@ -31,7 +31,7 @@ http = "1.3.1" http-serde = "2.1.1" humantime = "2.2.0" humantime-serde = "1.1.1" -human-sort = "0.2.2" +numeric-sort = "0.1.5" indicatif = "0.17.11" log = "0.4.27" openssl-sys = { version = "0.9.108", optional = true } diff --git a/lychee-bin/src/formatters/stats/compact.rs b/lychee-bin/src/formatters/stats/compact.rs index 74b5e38a81..2dcfcf6e48 100644 --- a/lychee-bin/src/formatters/stats/compact.rs +++ b/lychee-bin/src/formatters/stats/compact.rs @@ -52,7 +52,7 @@ impl Display for CompactResponseStats { let mut sorted_suggestions: Vec<_> = suggestions.iter().collect(); sorted_suggestions.sort_by(|a, b| { let (a, b) = (a.to_string().to_lowercase(), b.to_string().to_lowercase()); - human_sort::compare(&a, &b) + numeric_sort::cmp(&a, &b) }); writeln!(f, "\n\u{2139} Suggestions")?; diff --git a/lychee-bin/src/formatters/stats/detailed.rs b/lychee-bin/src/formatters/stats/detailed.rs index 696f7b3ec0..6ae44e0951 100644 --- a/lychee-bin/src/formatters/stats/detailed.rs +++ b/lychee-bin/src/formatters/stats/detailed.rs @@ -4,7 +4,6 @@ use crate::{formatters::get_response_formatter, options, stats::ResponseStats}; use anyhow::Result; use pad::{Alignment, PadStr}; use std::fmt::{self, Display}; - // Maximum padding for each entry in the final statistics output const MAX_PADDING: usize = 20; @@ -68,7 +67,7 @@ impl Display for DetailedResponseStats { let mut sorted_suggestions: Vec<_> = suggestions.iter().collect(); sorted_suggestions.sort_by(|a, b| { let (a, b) = (a.to_string().to_lowercase(), b.to_string().to_lowercase()); - human_sort::compare(&a, &b) + numeric_sort::cmp(&a, &b) }); writeln!(f, "\nSuggestions in {source}")?; diff --git a/lychee-bin/src/formatters/stats/mod.rs b/lychee-bin/src/formatters/stats/mod.rs index 00e3c54bf5..9380ca3e4b 100644 --- a/lychee-bin/src/formatters/stats/mod.rs +++ b/lychee-bin/src/formatters/stats/mod.rs @@ -36,7 +36,7 @@ where let mut sorted_responses: Vec<&T> = responses.iter().collect(); sorted_responses.sort_by(|a, b| { let (a, b) = (a.to_string().to_lowercase(), b.to_string().to_lowercase()); - human_sort::compare(&a, &b) + numeric_sort::cmp(&a, &b) }); (source, sorted_responses) @@ -45,7 +45,7 @@ where entries.sort_by(|(a, _), (b, _)| { let (a, b) = (a.to_string().to_lowercase(), b.to_string().to_lowercase()); - human_sort::compare(&a, &b) + numeric_sort::cmp(&a, &b) }); entries