diff options
author | Alisha Aneja <anejaalisha@yahoo.com> | 2017-07-01 16:05:06 +0300 |
---|---|---|
committer | Andrew Gallant <jamslam@gmail.com> | 2017-07-01 16:05:06 +0300 |
commit | c55dc9f4d522da1709dd02d8f40b0675a148ae71 (patch) | |
tree | 9061f8984579445e8cd5b0e756474fddbbc17d16 | |
parent | 938b0fa064e0b96eaebef5598ceeb0266219ca2e (diff) |
Add links to other walkdir items in WalkDir docs
Fixes #29
-rw-r--r-- | src/lib.rs | 20 |
1 files changed, 12 insertions, 8 deletions
@@ -162,7 +162,7 @@ pub type Result<T> = ::std::result::Result<T, Error>; /// /// This type implements `IntoIterator` so that it may be used as the subject /// of a `for` loop. You may need to call `into_iter` explicitly if you want -/// to use iterator adapters such as `filter_entry`. +/// to use iterator adapters such as [`filter_entry`]. /// /// Idiomatic use of this type should use method chaining to set desired /// options. For example, this only shows entries with a depth of `1`, `2` @@ -184,9 +184,11 @@ pub type Result<T> = ::std::result::Result<T, Error>; /// # } /// ``` /// +/// [`filter_entry`]: struct.IntoIter.html#method.filter_entry +/// /// Note that the iterator by default includes the top-most directory. Since /// this is the only directory yielded with depth `0`, it is easy to ignore it -/// with the `min_depth` setting: +/// with the [`min_depth`] setting: /// /// ```rust,no_run /// use walkdir::WalkDir; @@ -204,6 +206,8 @@ pub type Result<T> = ::std::result::Result<T, Error>; /// # } /// ``` /// +/// [`min_depth`]: struct.WalkDir.html#method.min_depth +/// /// This will only return descendents of the `foo` directory and not `foo` /// itself. /// @@ -341,11 +345,11 @@ impl WalkDir { self } - /// Yield a directory's contents before the directory itself. By default, + /// Yield a directory's contents before the directory itself. By default, /// this is disabled. /// - /// When `yes` is `false` (as is the default), the directory is yielded - /// before its contents are read. This is useful when, e.g. you want to + /// When `yes` is `false` (as is the default), the directory is yielded + /// before its contents are read. This is useful when, e.g. you want to /// skip processing of some directories. /// /// When `yes` is `true`, the iterator yields the contents of a directory @@ -399,7 +403,7 @@ impl WalkDir { /// // foo /// ``` - + pub fn contents_first(mut self, yes: bool) -> Self { self.opts.contents_first = yes; @@ -460,7 +464,7 @@ pub struct IntoIter { /// The current depth of iteration (the length of the stack at the /// beginning of each iteration). depth: usize, - /// A list of DirEntries corresponding to directories, that are + /// A list of DirEntries corresponding to directories, that are /// yielded after their contents has been fully yielded. This is only /// used when `contents_first` is enabled. deferred_dirs: Vec<DirEntry>, @@ -678,7 +682,7 @@ impl IntoIter { None } else { if self.skippable() { None } else { Some(Ok(dent)) } - } + } } fn get_deferred_dir(&mut self) -> Option<DirEntry> { |