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

Commit faf1fd3

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

File tree

3 files changed

+3
-15
lines changed

3 files changed

+3
-15
lines changed

src/compat.rs

Lines changed: 1 addition & 5 deletions
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

Lines changed: 1 addition & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -28,18 +28,14 @@ pub trait ResultExt<T, E> {
2828
/// struct CustomError;
2929
///
3030
/// impl Error for CustomError {
31-
/// fn description(&self) -> &str {
32-
/// "My custom error message"
33-
/// }
34-
///
3531
/// fn cause(&self) -> Option<&Error> {
3632
/// None
3733
/// }
3834
/// }
3935
/// #
4036
/// # impl fmt::Display for CustomError {
4137
/// # fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
42-
/// # write!(f, "{}", self.description())
38+
/// # write!(f, "My custom error message")
4339
/// # }
4440
/// # }
4541
/// #

src/sync_failure.rs

Lines changed: 1 addition & 5 deletions
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)