mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-05 20:30:57 +00:00
Replace failure dependency with impls of std::error::Error.
This commit is contained in:
parent
21b3257196
commit
81f906ca30
3 changed files with 8 additions and 5 deletions
|
|
@ -19,7 +19,6 @@ travis-ci = { repository = "dalek-cryptography/ed25519-dalek", branch = "master"
|
||||||
[dependencies]
|
[dependencies]
|
||||||
clear_on_drop = { version = "0.2" }
|
clear_on_drop = { version = "0.2" }
|
||||||
curve25519-dalek = { version = "1", default-features = false }
|
curve25519-dalek = { version = "1", default-features = false }
|
||||||
failure = { version = "0.1", default-features = false }
|
|
||||||
rand = { version = "0.7", default-features = false, optional = true }
|
rand = { version = "0.7", default-features = false, optional = true }
|
||||||
serde = { version = "1.0", optional = true }
|
serde = { version = "1.0", optional = true }
|
||||||
sha2 = { version = "0.8", default-features = false }
|
sha2 = { version = "0.8", default-features = false }
|
||||||
|
|
|
||||||
|
|
@ -16,6 +16,9 @@
|
||||||
use core::fmt;
|
use core::fmt;
|
||||||
use core::fmt::Display;
|
use core::fmt::Display;
|
||||||
|
|
||||||
|
#[cfg(feature = "std")]
|
||||||
|
use std::error::Error;
|
||||||
|
|
||||||
/// Internal errors. Most application-level developers will likely not
|
/// Internal errors. Most application-level developers will likely not
|
||||||
/// need to pay any attention to these.
|
/// need to pay any attention to these.
|
||||||
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
#[derive(Clone, Copy, Debug, Eq, PartialEq, Hash)]
|
||||||
|
|
@ -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.
|
/// Errors which may occur while processing signatures and keypairs.
|
||||||
///
|
///
|
||||||
|
|
@ -75,8 +79,9 @@ impl Display for SignatureError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
impl ::failure::Fail for SignatureError {
|
#[cfg(feature = "std")]
|
||||||
fn cause(&self) -> Option<&dyn (::failure::Fail)> {
|
impl Error for SignatureError {
|
||||||
|
fn source(&self) -> Option<&(dyn Error + 'static)> {
|
||||||
Some(&self.0)
|
Some(&self.0)
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
|
||||||
|
|
@ -241,7 +241,6 @@ extern crate std;
|
||||||
extern crate alloc;
|
extern crate alloc;
|
||||||
extern crate clear_on_drop;
|
extern crate clear_on_drop;
|
||||||
extern crate curve25519_dalek;
|
extern crate curve25519_dalek;
|
||||||
extern crate failure;
|
|
||||||
#[cfg(any(feature = "batch", feature = "std", feature = "alloc", test))]
|
#[cfg(any(feature = "batch", feature = "std", feature = "alloc", test))]
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
#[cfg(feature = "serde")]
|
#[cfg(feature = "serde")]
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue