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:
authorAndrew Gallant <jamslam@gmail.com>2019-06-06 02:01:37 +0300
committerAndrew Gallant <jamslam@gmail.com>2020-01-28 04:27:58 +0300
commit1d7293a5a1ef548ce587a0b08abce5f21571a100 (patch)
tree891328e6665280fbfbbd15351b829c04a237b054 /src/error.rs
parente4bd92f6a791f35593185539d91f9516161ab5ac (diff)
progressag/sys
Diffstat (limited to 'src/error.rs')
-rw-r--r--src/error.rs16
1 files changed, 15 insertions, 1 deletions
diff --git a/src/error.rs b/src/error.rs
index 3fb619c..49bf0b5 100644
--- a/src/error.rs
+++ b/src/error.rs
@@ -2,9 +2,23 @@ use std::error;
use std::fmt;
use std::io;
use std::path::{Path, PathBuf};
+use std::result;
use crate::DirEntry;
+/// A result type for walkdir operations.
+///
+/// Note that this result type embeds the error type in this crate. This
+/// is only useful if you care about the additional information provided by
+/// the error (such as the path associated with the error or whether a loop
+/// was dectected). If you want things to Just Work, then you can use
+/// [`io::Result`] instead since the error type in this package will
+/// automatically convert to an [`io::Result`] when using the [`try!`] macro.
+///
+/// [`io::Result`]: https://doc.rust-lang.org/stable/std/io/type.Result.html
+/// [`try!`]: https://doc.rust-lang.org/stable/std/macro.try.html
+pub type Result<T> = result::Result<T, Error>;
+
/// An error produced by recursively walking a directory.
///
/// This error type is a light wrapper around [`std::io::Error`]. In
@@ -98,7 +112,7 @@ impl Error {
///
/// # Example
///
- /// ```rust,no-run
+ /// ```rust,no_run
/// use std::io;
/// use std::path::Path;
///