1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-08-01 21:47:46 +00:00

sort: use Range.is_empty

This commit is contained in:
Thomas Queiroz 2021-10-23 23:22:21 -03:00
parent 5e5bb91043
commit 21a2d0ce40
No known key found for this signature in database
GPG key ID: 229D2DDF7ECA5F8F

View file

@ -659,10 +659,7 @@ impl<'a> Line<'a> {
" ".repeat(UnicodeWidthStr::width(&line[..selection.start])) " ".repeat(UnicodeWidthStr::width(&line[..selection.start]))
)?; )?;
// TODO: Once our minimum supported rust version is at least 1.47, use selection.is_empty() instead. if selection.is_empty() {
#[allow(clippy::len_zero)]
{
if selection.len() == 0 {
writeln!(writer, "^ no match for key")?; writeln!(writer, "^ no match for key")?;
} else { } else {
writeln!( writeln!(
@ -672,7 +669,6 @@ impl<'a> Line<'a> {
)?; )?;
} }
} }
}
if settings.mode != SortMode::Random if settings.mode != SortMode::Random
&& !settings.stable && !settings.stable
&& !settings.unique && !settings.unique