Correct walkdir docs

This commit is contained in:
Alisha 2017-07-09 13:02:12 +05:30 committed by Andrew Gallant
parent f21855c5e3
commit 3cc8e9ecc9

View File

@ -163,8 +163,10 @@ pub type Result<T> = ::std::result::Result<T, Error>;
/// A builder to create an iterator for recursively walking a directory.
///
/// Results are returned in depth first fashion, with directories yielded
/// before their contents. The order is unspecified. Directory entries `.`
/// and `..` are always omitted.
/// before their contents. If [`contents_first`] is true, contents are yielded
/// before their directories. The order is unspecified but if [`sort_by`] is given,
/// directory entries are sorted according to this function. Directory entries
///`.` and `..` are always omitted.
///
/// If an error occurs at any point during iteration, then it is returned in
/// place of its corresponding directory entry and iteration continues as
@ -172,6 +174,9 @@ pub type Result<T> = ::std::result::Result<T, Error>;
/// is skipped. Iteration may be stopped at any time. When the iterator is
/// destroyed, all resources associated with it are freed.
///
/// [`contents_first`]: struct.WalkDir.html#method.contents_first
/// [`sort_by`]: struct.WalkDir.html#method.sort_by
///
/// # Usage
///
/// This type implements [`IntoIterator`] so that it may be used as the subject