1
Fork 0

unifying name_bytes now that the two blocks are the same

This commit is contained in:
Dave Huseby 2016-01-26 21:37:46 -08:00
parent 0153e64d97
commit c83128eb60

View file

@ -211,14 +211,8 @@ impl DirEntry {
#[cfg(any(target_os = "macos", #[cfg(any(target_os = "macos",
target_os = "ios", target_os = "ios",
target_os = "netbsd", target_os = "netbsd",
target_os = "openbsd"))] target_os = "openbsd",
fn name_bytes(&self) -> &[u8] { target_os = "freebsd",
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 = "dragonfly", target_os = "dragonfly",
target_os = "bitrig"))] target_os = "bitrig"))]
fn name_bytes(&self) -> &[u8] { fn name_bytes(&self) -> &[u8] {