Skip to content

Commit c83128e

Browse files
author
Dave Huseby
committed
unifying name_bytes now that the two blocks are the same
1 parent 0153e64 commit c83128e

File tree

1 file changed

+2
-8
lines changed

1 file changed

+2
-8
lines changed

src/libstd/sys/unix/fs.rs

Lines changed: 2 additions & 8 deletions
Original file line numberDiff line numberDiff line change
@@ -211,14 +211,8 @@ impl DirEntry {
211211
#[cfg(any(target_os = "macos",
212212
target_os = "ios",
213213
target_os = "netbsd",
214-
target_os = "openbsd"))]
215-
fn name_bytes(&self) -> &[u8] {
216-
unsafe {
217-
::slice::from_raw_parts(self.entry.d_name.as_ptr() as *const u8,
218-
self.entry.d_namlen as usize)
219-
}
220-
}
221-
#[cfg(any(target_os = "freebsd",
214+
target_os = "openbsd",
215+
target_os = "freebsd",
222216
target_os = "dragonfly",
223217
target_os = "bitrig"))]
224218
fn name_bytes(&self) -> &[u8] {

0 commit comments

Comments
 (0)