From 5241eca084041d0e9be1715c821f885f26a74bef Mon Sep 17 00:00:00 2001 From: Roy Ivy III Date: Sun, 29 Dec 2019 00:04:55 -0600 Subject: [PATCH] refactor/polish ~ fix `cargo clippy` complaints (allow comparison_chain {for f64 comparisons}) --- src/sort/sort.rs | 3 +++ 1 file changed, 3 insertions(+) diff --git a/src/sort/sort.rs b/src/sort/sort.rs index f982320eb..2259bea0c 100644 --- a/src/sort/sort.rs +++ b/src/sort/sort.rs @@ -398,6 +398,7 @@ fn default_compare(a: &str, b: &str) -> Ordering { /// Stops coercing at the first whitespace char, so 1e2 will parse as 100 but /// 1,000 will parse as -inf. fn numeric_compare(a: &str, b: &str) -> Ordering { + #![allow(clippy::comparison_chain)] let fa = permissive_f64_parse(a); let fb = permissive_f64_parse(b); // f64::cmp isn't implemented because NaN messes with it @@ -434,8 +435,10 @@ fn human_numeric_convert(a: &str) -> f64 { /// Compare two strings as if they are human readable sizes. /// AKA 1M > 100k fn human_numeric_size_compare(a: &str, b: &str) -> Ordering { + #![allow(clippy::comparison_chain)] let fa = human_numeric_convert(a); let fb = human_numeric_convert(b); + // f64::cmp isn't implemented (due to NaN issues); implement directly instead if fa > fb { Ordering::Greater } else if fa < fb {