mirror of
https://github.com/RGBCube/uutils-coreutils
synced 2025-08-01 13:37:48 +00:00
sort: use Range.is_empty
This commit is contained in:
parent
5e5bb91043
commit
21a2d0ce40
1 changed files with 8 additions and 12 deletions
|
@ -659,18 +659,14 @@ 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)]
|
writeln!(writer, "^ no match for key")?;
|
||||||
{
|
} else {
|
||||||
if selection.len() == 0 {
|
writeln!(
|
||||||
writeln!(writer, "^ no match for key")?;
|
writer,
|
||||||
} else {
|
"{}",
|
||||||
writeln!(
|
"_".repeat(UnicodeWidthStr::width(&line[selection]))
|
||||||
writer,
|
)?;
|
||||||
"{}",
|
|
||||||
"_".repeat(UnicodeWidthStr::width(&line[selection]))
|
|
||||||
)?;
|
|
||||||
}
|
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
if settings.mode != SortMode::Random
|
if settings.mode != SortMode::Random
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue