mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-05 20:30:57 +00:00
Use failure instead of std::error::Error.
failure is no_std compatible, whereas std::error::Error is not.
This commit is contained in:
parent
96246506c0
commit
6c1acaca7c
3 changed files with 7 additions and 7 deletions
|
|
@ -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"]
|
||||
|
|
|
|||
|
|
@ -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> {
|
||||
|
|
|
|||
|
|
@ -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;
|
||||
|
|
|
|||
Loading…
Reference in a new issue