diff --git a/src/error/multiple_error_types/define_error_type.md b/src/error/multiple_error_types/define_error_type.md index b7187d0d01..45e5766690 100644 --- a/src/error/multiple_error_types/define_error_type.md +++ b/src/error/multiple_error_types/define_error_type.md @@ -40,11 +40,7 @@ impl fmt::Display for DoubleError { // This is important for other errors to wrap this one. impl error::Error for DoubleError { - fn description(&self) -> &str { - "invalid first item to double" - } - - fn cause(&self) -> Option<&error::Error> { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { // Generic error, underlying cause isn't tracked. None } diff --git a/src/error/multiple_error_types/wrap_error.md b/src/error/multiple_error_types/wrap_error.md index 15c0d662a0..f384c0c247 100644 --- a/src/error/multiple_error_types/wrap_error.md +++ b/src/error/multiple_error_types/wrap_error.md @@ -29,15 +29,7 @@ impl fmt::Display for DoubleError { } impl error::Error for DoubleError { - fn description(&self) -> &str { - match *self { - DoubleError::EmptyVec => "empty vectors not allowed", - // This already impls `Error`, so defer to its own implementation. - DoubleError::Parse(ref e) => e.description(), - } - } - - fn cause(&self) -> Option<&error::Error> { + fn source(&self) -> Option<&(dyn error::Error + 'static)> { match *self { DoubleError::EmptyVec => None, // The cause is the underlying implementation error type. Is implicitly