Skip to content

Commit

Permalink
Replace failure dependency with impls of std::error::Error.
Browse files Browse the repository at this point in the history
  • Loading branch information
isislovecruft committed Oct 26, 2019
1 parent 21b3257 commit 81f906c
Show file tree
Hide file tree
Showing 3 changed files with 8 additions and 5 deletions.
1 change: 0 additions & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -19,7 +19,6 @@ travis-ci = { repository = "dalek-cryptography/ed25519-dalek", branch = "master"
[dependencies]
clear_on_drop = { version = "0.2" }
curve25519-dalek = { version = "1", default-features = false }
failure = { version = "0.1", default-features = false }
rand = { version = "0.7", default-features = false, optional = true }
serde = { version = "1.0", optional = true }
sha2 = { version = "0.8", default-features = false }
Expand Down
11 changes: 8 additions & 3 deletions src/errors.rs
Original file line number Diff line number Diff line change
Expand Up @@ -16,6 +16,9 @@
use core::fmt;
use core::fmt::Display;

#[cfg(feature = "std")]
use std::error::Error;

/// Internal errors. Most application-level developers will likely not
/// need to pay any attention to these.
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
Expand Down Expand Up @@ -50,7 +53,8 @@ impl Display for InternalError {
}
}

impl ::failure::Fail for InternalError {}
#[cfg(feature = "std")]
impl Error for InternalError { }

/// Errors which may occur while processing signatures and keypairs.
///
Expand All @@ -75,8 +79,9 @@ impl Display for SignatureError {
}
}

impl ::failure::Fail for SignatureError {
fn cause(&self) -> Option<&dyn (::failure::Fail)> {
#[cfg(feature = "std")]
impl Error for SignatureError {
fn source(&self) -> Option<&(dyn Error + 'static)> {
Some(&self.0)
}
}
1 change: 0 additions & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -241,7 +241,6 @@ extern crate std;
extern crate alloc;
extern crate clear_on_drop;
extern crate curve25519_dalek;
extern crate failure;
#[cfg(any(feature = "batch", feature = "std", feature = "alloc", test))]
extern crate rand;
#[cfg(feature = "serde")]
Expand Down

0 comments on commit 81f906c

Please sign in to comment.