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 17, 2019
1 parent 20f9a9e commit 85651bd
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 24 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
20 changes: 6 additions & 14 deletions src/result_ext.rs
Original file line number Diff line number Diff line change
Expand Up @@ -18,31 +18,23 @@ pub trait ResultExt<T, E> {
/// #
/// # #[cfg(all(feature = "std", feature = "derive"))] mod tests {
/// use std::error::Error;
/// # use std::fmt;
/// use std::fmt;
/// #
/// # extern crate failure;
/// #
/// # use tests::failure::ResultExt;
/// #
/// # #[derive(Debug)]
/// #[derive(Debug)]
/// struct CustomError;
///
/// impl Error for CustomError {
/// fn description(&self) -> &str {
/// "My custom error message"
/// }
/// impl Error for CustomError {}
///
/// fn cause(&self) -> Option<&Error> {
/// None
/// impl fmt::Display for CustomError {
/// fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
/// write!(f, "My custom error message")
/// }
/// }
/// #
/// # impl fmt::Display for CustomError {
/// # fn fmt(&self, f: &mut fmt::Formatter) -> fmt::Result {
/// # write!(f, "{}", self.description())
/// # }
/// # }
/// #
/// # pub fn run_test() {
///
/// let x = (|| -> Result<(), failure::Error> {
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 85651bd

Please sign in to comment.