Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 85651bd

Browse files
committed
remove deprecated Error::description
1 parent 20f9a9e commit 85651bd

File tree

3 files changed

+8
-24
lines changed

3 files changed

+8
-24
lines changed

src/compat.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -33,11 +33,7 @@ with_std! {
3333

3434
use Error;
3535

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> {}
4137

4238
impl From<Error> for Box<dyn StdError> {
4339
fn from(error: Error) -> Box<dyn StdError> {

src/result_ext.rs

+6-14
Original file line numberDiff line numberDiff line change
@@ -18,31 +18,23 @@ pub trait ResultExt<T, E> {
1818
/// #
1919
/// # #[cfg(all(feature = "std", feature = "derive"))] mod tests {
2020
/// use std::error::Error;
21-
/// # use std::fmt;
21+
/// use std::fmt;
2222
/// #
2323
/// # extern crate failure;
2424
/// #
2525
/// # use tests::failure::ResultExt;
2626
/// #
27-
/// # #[derive(Debug)]
27+
/// #[derive(Debug)]
2828
/// struct CustomError;
2929
///
30-
/// impl Error for CustomError {
31-
/// fn description(&self) -> &str {
32-
/// "My custom error message"
33-
/// }
30+
/// impl Error for CustomError {}
3431
///
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")
3735
/// }
3836
/// }
3937
/// #
40-
/// # impl fmt::Display for CustomError {
41-
/// # fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
42-
/// # write!(f, "{}", self.description())
43-
/// # }
44-
/// # }
45-
/// #
4638
/// # pub fn run_test() {
4739
///
4840
/// let x = (|| -> Result<(), failure::Error> {

src/sync_failure.rs

+1-5
Original file line numberDiff line numberDiff line change
@@ -39,11 +39,7 @@ impl<E: Error + Send + 'static> SyncFailure<E> {
3939
///
4040
/// // implement Display/Error for NonSyncError...
4141
/// #
42-
/// # impl StdError for NonSyncError {
43-
/// # fn description(&self) -> &str {
44-
/// # "oops!"
45-
/// # }
46-
/// # }
42+
/// # impl StdError for NonSyncError {}
4743
/// #
4844
/// # impl Display for NonSyncError {
4945
/// # fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {

0 commit comments

Comments
 (0)