diff --git a/src/libstd/sys/unix/fs.rs b/src/libstd/sys/unix/fs.rs index 9da986d7fbfd..919318112346 100644 --- a/src/libstd/sys/unix/fs.rs +++ b/src/libstd/sys/unix/fs.rs @@ -211,14 +211,8 @@ impl DirEntry { #[cfg(any(target_os = "macos", target_os = "ios", target_os = "netbsd", - target_os = "openbsd"))] - fn name_bytes(&self) -> &[u8] { - unsafe { - ::slice::from_raw_parts(self.entry.d_name.as_ptr() as *const u8, - self.entry.d_namlen as usize) - } - } - #[cfg(any(target_os = "freebsd", + target_os = "openbsd", + target_os = "freebsd", target_os = "dragonfly", target_os = "bitrig"))] fn name_bytes(&self) -> &[u8] {