Skip to content

Commit 1d06b07

Browse files
cuviperdtolnay
andauthored
simplify the cfg in ReadDir construction
Co-authored-by: David Tolnay <[email protected]>
1 parent 365e00a commit 1d06b07

File tree

1 file changed

+6
-8
lines changed
  • library/std/src/sys/unix

1 file changed

+6
-8
lines changed

library/std/src/sys/unix/fs.rs

+6-8
Original file line numberDiff line numberDiff line change
@@ -949,18 +949,16 @@ pub fn readdir(p: &Path) -> io::Result<ReadDir> {
949949
Err(Error::last_os_error())
950950
} else {
951951
let inner = InnerReadDir { dirp: Dir(ptr), root };
952-
cfg_if::cfg_if! {
953-
if #[cfg(not(any(
952+
Ok(ReadDir {
953+
inner: Arc::new(inner),
954+
#[cfg(not(any(
954955
target_os = "solaris",
955956
target_os = "illumos",
956957
target_os = "fuchsia",
957958
target_os = "redox",
958-
)))] {
959-
Ok(ReadDir { inner: Arc::new(inner), end_of_stream: false })
960-
} else {
961-
Ok(ReadDir { inner: Arc::new(inner) })
962-
}
963-
}
959+
)))]
960+
end_of_stream: false,
961+
})
964962
}
965963
}
966964
}

0 commit comments

Comments
 (0)