diff --git a/src/uu/ls/src/display.rs b/src/uu/ls/src/display.rs index a0b0b2eeb..eb61816a8 100644 --- a/src/uu/ls/src/display.rs +++ b/src/uu/ls/src/display.rs @@ -35,17 +35,7 @@ use term_grid::{DEFAULT_SEPARATOR_SIZE, Direction, Filling, Grid, GridOptions}; use uucore::entries; #[cfg(all(unix, not(any(target_os = "android", target_os = "macos"))))] use uucore::fsxattr::has_acl; -#[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "netbsd", - target_os = "openbsd", - target_os = "illumos", - target_os = "solaris", - target_vendor = "apple" -))] +#[cfg(unix)] use uucore::libc::{dev_t, major, minor}; use uucore::{ error::UResult, @@ -627,17 +617,7 @@ fn display_date( } fn display_len_or_rdev(metadata: &Metadata, config: &Config) -> SizeOrDeviceId { - #[cfg(any( - target_os = "linux", - target_os = "android", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "netbsd", - target_os = "openbsd", - target_os = "illumos", - target_os = "solaris", - target_vendor = "apple" - ))] + #[cfg(unix)] { let ft = metadata.file_type(); if ft.is_char_device() || ft.is_block_device() { diff --git a/tests/by-util/test_ls.rs b/tests/by-util/test_ls.rs index 8eb10f5a0..52e639715 100644 --- a/tests/by-util/test_ls.rs +++ b/tests/by-util/test_ls.rs @@ -5054,16 +5054,7 @@ fn test_tabsize_formatting() { .stdout_is("aaaaaaaa cccc\nbbbb dddddddd\n"); } -#[cfg(any( - target_os = "linux", - target_os = "freebsd", - target_os = "dragonfly", - target_os = "netbsd", - target_os = "openbsd", - target_os = "illumos", - target_os = "solaris", - target_vendor = "apple" -))] +#[cfg(all(unix, not(target_os = "android")))] #[test] fn test_device_number() { use std::fs::{metadata, read_dir};