about summary refs log tree commit diff
path: root/library/std/src
diff options
context:
space:
mode:
authorJosh Stone <cuviper@gmail.com>2020-10-09 10:54:50 -0700
committerGitHub <noreply@github.com>2020-10-09 10:54:50 -0700
commit1d06b07765e1be71f3aeec1d0c0f365b0907c7a8 (patch)
tree31ea1b0985eb4ab9e01c2dc8230519df42c233b8 /library/std/src
parent365e00aeeee4c84e29a2fdbee18faa69edcae2ee (diff)
downloadrust-1d06b07765e1be71f3aeec1d0c0f365b0907c7a8.tar.gz
rust-1d06b07765e1be71f3aeec1d0c0f365b0907c7a8.zip
simplify the cfg in ReadDir construction
Co-authored-by: David Tolnay <dtolnay@gmail.com>
Diffstat (limited to 'library/std/src')
-rw-r--r--library/std/src/sys/unix/fs.rs14
1 files changed, 6 insertions, 8 deletions
diff --git a/library/std/src/sys/unix/fs.rs b/library/std/src/sys/unix/fs.rs
index 2c7a7e55d0e..8184c25afcf 100644
--- a/library/std/src/sys/unix/fs.rs
+++ b/library/std/src/sys/unix/fs.rs
@@ -949,18 +949,16 @@ pub fn readdir(p: &Path) -> io::Result<ReadDir> {
             Err(Error::last_os_error())
         } else {
             let inner = InnerReadDir { dirp: Dir(ptr), root };
-            cfg_if::cfg_if! {
-                if #[cfg(not(any(
+            Ok(ReadDir {
+                inner: Arc::new(inner),
+                #[cfg(not(any(
                     target_os = "solaris",
                     target_os = "illumos",
                     target_os = "fuchsia",
                     target_os = "redox",
-                )))] {
-                    Ok(ReadDir { inner: Arc::new(inner), end_of_stream: false })
-                } else {
-                    Ok(ReadDir { inner: Arc::new(inner) })
-                }
-            }
+                )))]
+                end_of_stream: false,
+            })
         }
     }
 }