diff options
author | Ashley Mannix <ashleymannix@live.com.au> | 2017-08-04 01:27:26 +0300 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2017-08-04 01:52:10 +0300 |
commit | 9d55d29fcb71f95cdba74eb05aac94aadc70fe57 (patch) | |
tree | 5ff8392cf9c5467acf96bed3db1af1eb0b25546d | |
parent | 107750f24e1a173c4dfd2b7bb6e495a375e0dfb8 (diff) |
Move DirEntry::ino method to an extension trait
Fixes #46
-rw-r--r-- | src/lib.rs | 16 |
1 files changed, 9 insertions, 7 deletions
@@ -962,13 +962,6 @@ impl DirEntry { self.depth } - /// Returns the underlying `d_ino` field in the contained `dirent` - /// structure. - #[cfg(unix)] - pub fn ino(&self) -> u64 { - self.ino - } - #[cfg(not(unix))] fn from_entry(depth: usize, ent: &fs::DirEntry) -> Result<DirEntry> { let ty = try!(ent.file_type().map_err(|err| { @@ -1028,6 +1021,15 @@ impl DirEntry { } } +#[cfg(unix)] +impl std::os::unix::fs::DirEntryExt for DirEntry { + /// Returns the underlying `d_ino` field in the contained `dirent` + /// structure. + fn ino(&self) -> u64 { + self.ino + } +} + impl Clone for DirEntry { #[cfg(not(unix))] fn clone(&self) -> DirEntry { |