Skip to content

Commit 2f49d8e

Browse files
oech3cakebaker
authored andcommitted
ls: use cfg unix
1 parent 25a5b3f commit 2f49d8e

2 files changed

Lines changed: 3 additions & 32 deletions

File tree

src/uu/ls/src/display.rs

Lines changed: 2 additions & 22 deletions
Original file line numberDiff line numberDiff line change
@@ -35,17 +35,7 @@ use term_grid::{DEFAULT_SEPARATOR_SIZE, Direction, Filling, Grid, GridOptions};
3535
use uucore::entries;
3636
#[cfg(all(unix, not(any(target_os = "android", target_os = "macos"))))]
3737
use uucore::fsxattr::has_acl;
38-
#[cfg(any(
39-
target_os = "linux",
40-
target_os = "android",
41-
target_os = "freebsd",
42-
target_os = "dragonfly",
43-
target_os = "netbsd",
44-
target_os = "openbsd",
45-
target_os = "illumos",
46-
target_os = "solaris",
47-
target_vendor = "apple"
48-
))]
38+
#[cfg(unix)]
4939
use uucore::libc::{dev_t, major, minor};
5040
use uucore::{
5141
error::UResult,
@@ -627,17 +617,7 @@ fn display_date(
627617
}
628618

629619
fn display_len_or_rdev(metadata: &Metadata, config: &Config) -> SizeOrDeviceId {
630-
#[cfg(any(
631-
target_os = "linux",
632-
target_os = "android",
633-
target_os = "freebsd",
634-
target_os = "dragonfly",
635-
target_os = "netbsd",
636-
target_os = "openbsd",
637-
target_os = "illumos",
638-
target_os = "solaris",
639-
target_vendor = "apple"
640-
))]
620+
#[cfg(unix)]
641621
{
642622
let ft = metadata.file_type();
643623
if ft.is_char_device() || ft.is_block_device() {

tests/by-util/test_ls.rs

Lines changed: 1 addition & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -5054,16 +5054,7 @@ fn test_tabsize_formatting() {
50545054
.stdout_is("aaaaaaaa cccc\nbbbb dddddddd\n");
50555055
}
50565056

5057-
#[cfg(any(
5058-
target_os = "linux",
5059-
target_os = "freebsd",
5060-
target_os = "dragonfly",
5061-
target_os = "netbsd",
5062-
target_os = "openbsd",
5063-
target_os = "illumos",
5064-
target_os = "solaris",
5065-
target_vendor = "apple"
5066-
))]
5057+
#[cfg(all(unix, not(target_os = "android")))]
50675058
#[test]
50685059
fn test_device_number() {
50695060
use std::fs::{metadata, read_dir};

0 commit comments

Comments
 (0)