Welcome to mirror list, hosted at ThFree Co, Russian Federation.

github.com/windirstat/walkdir.git - Unnamed repository; edit this file 'description' to name the repository.
summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorAshley Mannix <ashleymannix@live.com.au>2017-08-04 01:27:26 +0300
committerAndrew Gallant <jamslam@gmail.com>2017-08-04 01:52:10 +0300
commit9d55d29fcb71f95cdba74eb05aac94aadc70fe57 (patch)
tree5ff8392cf9c5467acf96bed3db1af1eb0b25546d
parent107750f24e1a173c4dfd2b7bb6e495a375e0dfb8 (diff)
Move DirEntry::ino method to an extension trait
Fixes #46
-rw-r--r--src/lib.rs16
1 files changed, 9 insertions, 7 deletions
diff --git a/src/lib.rs b/src/lib.rs
index fd848d5..6ed71aa 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -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 {