mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-04 15:07:47 +00:00
refactor/polish ~ fix cargo clippy
complaints (match function signatures)
This commit is contained in:
parent
c6817aefb3
commit
c6e9808224
1 changed files with 6 additions and 2 deletions
|
@ -254,13 +254,13 @@ With no FILE, or when FILE is -, read standard input.",
|
||||||
SortMode::HumanNumeric => human_numeric_size_compare,
|
SortMode::HumanNumeric => human_numeric_size_compare,
|
||||||
SortMode::Month => month_compare,
|
SortMode::Month => month_compare,
|
||||||
SortMode::Version => version_compare,
|
SortMode::Version => version_compare,
|
||||||
SortMode::Default => String::cmp,
|
SortMode::Default => default_compare,
|
||||||
});
|
});
|
||||||
|
|
||||||
if !settings.stable {
|
if !settings.stable {
|
||||||
match settings.mode {
|
match settings.mode {
|
||||||
SortMode::Default => {}
|
SortMode::Default => {}
|
||||||
_ => settings.compare_fns.push(String::cmp),
|
_ => settings.compare_fns.push(default_compare),
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
@ -395,6 +395,10 @@ fn permissive_f64_parse(a: &str) -> f64 {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
|
fn default_compare(a: &str, b: &str) -> Ordering {
|
||||||
|
a.cmp(b)
|
||||||
|
}
|
||||||
|
|
||||||
/// Compares two floating point numbers, with errors being assumed to be -inf.
|
/// Compares two floating point numbers, with errors being assumed to be -inf.
|
||||||
/// Stops coercing at the first whitespace char, so 1e2 will parse as 100 but
|
/// Stops coercing at the first whitespace char, so 1e2 will parse as 100 but
|
||||||
/// 1,000 will parse as -inf.
|
/// 1,000 will parse as -inf.
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue