This repository was archived by the owner on Aug 16, 2021. It is now read-only.
File tree 3 files changed +8
-24
lines changed
3 files changed +8
-24
lines changed Original file line number Diff line number Diff line change @@ -33,11 +33,7 @@ with_std! {
33
33
34
34
use Error ;
35
35
36
- impl <E : Display + Debug > StdError for Compat <E > {
37
- fn description( & self ) -> & ' static str {
38
- "An error has occurred."
39
- }
40
- }
36
+ impl <E : Display + Debug > StdError for Compat <E > { }
41
37
42
38
impl From <Error > for Box <dyn StdError > {
43
39
fn from( error: Error ) -> Box <dyn StdError > {
Original file line number Diff line number Diff line change @@ -18,31 +18,23 @@ pub trait ResultExt<T, E> {
18
18
/// #
19
19
/// # #[cfg(all(feature = "std", feature = "derive"))] mod tests {
20
20
/// use std::error::Error;
21
- /// # use std::fmt;
21
+ /// use std::fmt;
22
22
/// #
23
23
/// # extern crate failure;
24
24
/// #
25
25
/// # use tests::failure::ResultExt;
26
26
/// #
27
- /// # # [derive(Debug)]
27
+ /// #[derive(Debug)]
28
28
/// struct CustomError;
29
29
///
30
- /// impl Error for CustomError {
31
- /// fn description(&self) -> &str {
32
- /// "My custom error message"
33
- /// }
30
+ /// impl Error for CustomError {}
34
31
///
35
- /// fn cause(&self) -> Option<&Error> {
36
- /// None
32
+ /// impl fmt::Display for CustomError {
33
+ /// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
34
+ /// write!(f, "My custom error message")
37
35
/// }
38
36
/// }
39
37
/// #
40
- /// # impl fmt::Display for CustomError {
41
- /// # fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
42
- /// # write!(f, "{}", self.description())
43
- /// # }
44
- /// # }
45
- /// #
46
38
/// # pub fn run_test() {
47
39
///
48
40
/// let x = (|| -> Result<(), failure::Error> {
Original file line number Diff line number Diff line change @@ -39,11 +39,7 @@ impl<E: Error + Send + 'static> SyncFailure<E> {
39
39
///
40
40
/// // implement Display/Error for NonSyncError...
41
41
/// #
42
- /// # impl StdError for NonSyncError {
43
- /// # fn description(&self) -> &str {
44
- /// # "oops!"
45
- /// # }
46
- /// # }
42
+ /// # impl StdError for NonSyncError {}
47
43
/// #
48
44
/// # impl Display for NonSyncError {
49
45
/// # fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
You can’t perform that action at this time.
0 commit comments