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:
authorJérémie Lawson <jeremielate@gmail.com>2017-08-04 01:30:16 +0300
committerAndrew Gallant <jamslam@gmail.com>2017-08-04 01:52:10 +0300
commitc4af8e617302063c2f33e9709dcd99c4f0819b6f (patch)
treea69ac90a1a71c73655f9c6ecead057ac516cb65d
parent9d55d29fcb71f95cdba74eb05aac94aadc70fe57 (diff)
Use doc from std::os::unix::fs::DirEntryExt for trait walkdir::unix::DirEntryExt.
Moved trait implementation for DirEntry in module unix.
-rw-r--r--src/lib.rs10
-rw-r--r--src/unix.rs15
2 files changed, 16 insertions, 9 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 6ed71aa..0d700cc 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -132,6 +132,7 @@ use std::vec;
use same_file::is_same_file;
+#[cfg(unix)] mod unix;
#[cfg(test)] mod tests;
/// Like try, but for iterators that return [`Option<Result<_, _>>`].
@@ -1021,15 +1022,6 @@ 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 {
diff --git a/src/unix.rs b/src/unix.rs
new file mode 100644
index 0000000..c8f495f
--- /dev/null
+++ b/src/unix.rs
@@ -0,0 +1,15 @@
+use DirEntry;
+
+/// Unix-specific extension methods for `walkdir::DirEntry`
+pub trait DirEntryExt {
+ /// Returns the underlying `d_ino` field in the contained `dirent` structure.
+ fn ino(&self) -> u64;
+}
+
+impl DirEntryExt for DirEntry {
+ /// Returns the underlying `d_ino` field in the contained `dirent`
+ /// structure.
+ fn ino(&self) -> u64 {
+ self.ino
+ }
+}