Use failure instead of std::error::Error.

failure is no_std compatible, whereas std::error::Error is not.
This commit is contained in:
Without Boats 2017-12-06 15:25:12 -08:00
parent 96246506c0
commit 6c1acaca7c
No known key found for this signature in database
GPG key ID: 1CC70310BE3912D5
3 changed files with 7 additions and 7 deletions

View file

@ -45,6 +45,10 @@ optional = true
version = "^0.6"
optional = true
[dependencies.failure]
version = "^0.1.1"
default-features = false
[dev-dependencies]
hex = "0.2"
sha2 = "^0.6"
@ -52,7 +56,7 @@ bincode = "^0.9"
[features]
default = ["std"]
std = ["rand", "curve25519-dalek/std"]
std = ["rand", "curve25519-dalek/std", "failure/std"]
bench = []
nightly = ["curve25519-dalek/nightly"]
asm = ["sha2/asm"]

View file

@ -908,12 +908,7 @@ impl Display for FromBytesError {
}
}
#[cfg(feature = "std")]
impl ::std::error::Error for FromBytesError {
fn description(&self) -> &str {
"wrong length of bytes when constructing ed25519 object"
}
}
impl ::failure::Fail for FromBytesError { }
#[inline(always)]
fn check_bytes_len(bytes: &[u8], len: usize) -> Result<(), FromBytesError> {

View file

@ -263,6 +263,7 @@ extern crate curve25519_dalek;
extern crate generic_array;
extern crate digest;
extern crate subtle;
extern crate failure;
#[cfg(feature = "std")]
extern crate rand;