Skip to content

Commit

Permalink
unifying name_bytes now that the two blocks are the same
Browse files Browse the repository at this point in the history
  • Loading branch information
Dave Huseby committed Feb 3, 2016
1 parent 0153e64 commit c83128e
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions src/libstd/sys/unix/fs.rs
Expand Up @@ -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] {
Expand Down

0 comments on commit c83128e

Please sign in to comment.