Skip to content

Commit 7f2bb49

Browse files
committed
Adds and fixes missing_docs warnings
1 parent 86410fe commit 7f2bb49

File tree

1 file changed

+11
-0
lines changed

1 file changed

+11
-0
lines changed

src/lib.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -1,3 +1,4 @@
1+
#![warn(missing_docs)]
12
//! A macro which makes errors easy to write
23
//!
34
//! Minimum type is like this:
@@ -981,10 +982,20 @@ macro_rules! quick_error {
981982
}
982983

983984

985+
/// Generic context type
986+
///
987+
/// Used mostly as a transport for `ResultExt::context` method
984988
#[derive(Debug)]
985989
pub struct Context<X, E>(pub X, pub E);
986990

991+
/// Result extension trait adding a `context` method
987992
pub trait ResultExt<T, E> {
993+
/// The method is use to add context information to current operation
994+
///
995+
/// The context data is then used in error constructor to store additional
996+
/// information within error. For example, you may add a filename as a
997+
/// context for file operation. See crate documentation for the actual
998+
/// example.
988999
fn context<X>(self, x: X) -> Result<T, Context<X, E>>;
9891000
}
9901001

0 commit comments

Comments
 (0)