Skip to content

Commit a07426a

Browse files
committed
ls: simplify the code, we don't need the len
1 parent 5442fe4 commit a07426a

1 file changed

Lines changed: 2 additions & 2 deletions

File tree

src/uu/ls/src/ls.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2846,7 +2846,7 @@ fn display_item_long(
28462846
#[cfg(all(unix, not(any(target_os = "android", target_os = "macos"))))]
28472847
let is_acl_set = has_acl(item.display_name.as_os_str());
28482848
output_display.extend(display_permissions(md, true).as_bytes());
2849-
if item.security_context.len() > 1 {
2849+
if !item.security_context.is_empty() {
28502850
// GNU `ls` uses a "." character to indicate a file with a security context,
28512851
// but not other alternate access method.
28522852
output_display.extend(b".");
@@ -2976,7 +2976,7 @@ fn display_item_long(
29762976

29772977
output_display.extend(leading_char.as_bytes());
29782978
output_display.extend(b"?????????");
2979-
if item.security_context.len() > 1 {
2979+
if !item.security_context.is_empty() {
29802980
// GNU `ls` uses a "." character to indicate a file with a security context,
29812981
// but not other alternate access method.
29822982
output_display.extend(b".");

0 commit comments

Comments
 (0)