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

Commit

Permalink
remove deprecated Error::description
Browse files Browse the repository at this point in the history
  • Loading branch information
AnderEnder committed Dec 15, 2019
1 parent 20f9a9e commit faf1fd3
Show file tree
Hide file tree
Showing 3 changed files with 3 additions and 15 deletions.
6 changes: 1 addition & 5 deletions src/compat.rs
Original file line number Diff line number Diff line change
Expand Up @@ -33,11 +33,7 @@ with_std! {

use Error;

impl<E: Display + Debug> StdError for Compat<E> {
fn description(&self) -> &'static str {
"An error has occurred."
}
}
impl<E: Display + Debug> StdError for Compat<E> {}

impl From<Error> for Box<dyn StdError> {
fn from(error: Error) -> Box<dyn StdError> {
Expand Down
6 changes: 1 addition & 5 deletions src/result_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -28,18 +28,14 @@ pub trait ResultExt<T, E> {
/// struct CustomError;
///
/// impl Error for CustomError {
/// fn description(&self) -> &str {
/// "My custom error message"
/// }
///
/// fn cause(&self) -> Option<&Error> {
/// None
/// }
/// }
/// #
/// # impl fmt::Display for CustomError {
/// # fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
/// # write!(f, "{}", self.description())
/// # write!(f, "My custom error message")
/// # }
/// # }
/// #
Expand Down
6 changes: 1 addition & 5 deletions src/sync_failure.rs
Original file line number Diff line number Diff line change
Expand Up @@ -39,11 +39,7 @@ impl<E: Error + Send + 'static> SyncFailure<E> {
///
/// // implement Display/Error for NonSyncError...
/// #
/// # impl StdError for NonSyncError {
/// # fn description(&self) -> &str {
/// # "oops!"
/// # }
/// # }
/// # impl StdError for NonSyncError {}
/// #
/// # impl Display for NonSyncError {
/// # fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
Expand Down

0 comments on commit faf1fd3

Please sign in to comment.