mirror of
https://github.com/saymrwulf/curve25519-dalek-source.git
synced 2026-09-07 20:50:39 +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"
|
version = "^0.6"
|
||||||
optional = true
|
optional = true
|
||||||
|
|
||||||
|
[dependencies.failure]
|
||||||
|
version = "^0.1.1"
|
||||||
|
default-features = false
|
||||||
|
|
||||||
[dev-dependencies]
|
[dev-dependencies]
|
||||||
hex = "0.2"
|
hex = "0.2"
|
||||||
sha2 = "^0.6"
|
sha2 = "^0.6"
|
||||||
|
|
@ -52,7 +56,7 @@ bincode = "^0.9"
|
||||||
|
|
||||||
[features]
|
[features]
|
||||||
default = ["std"]
|
default = ["std"]
|
||||||
std = ["rand", "curve25519-dalek/std"]
|
std = ["rand", "curve25519-dalek/std", "failure/std"]
|
||||||
bench = []
|
bench = []
|
||||||
nightly = ["curve25519-dalek/nightly"]
|
nightly = ["curve25519-dalek/nightly"]
|
||||||
asm = ["sha2/asm"]
|
asm = ["sha2/asm"]
|
||||||
|
|
|
||||||
|
|
@ -908,12 +908,7 @@ impl Display for FromBytesError {
|
||||||
}
|
}
|
||||||
}
|
}
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
impl ::failure::Fail for FromBytesError { }
|
||||||
impl ::std::error::Error for FromBytesError {
|
|
||||||
fn description(&self) -> &str {
|
|
||||||
"wrong length of bytes when constructing ed25519 object"
|
|
||||||
}
|
|
||||||
}
|
|
||||||
|
|
||||||
#[inline(always)]
|
#[inline(always)]
|
||||||
fn check_bytes_len(bytes: &[u8], len: usize) -> Result<(), FromBytesError> {
|
fn check_bytes_len(bytes: &[u8], len: usize) -> Result<(), FromBytesError> {
|
||||||
|
|
|
||||||
|
|
@ -263,6 +263,7 @@ extern crate curve25519_dalek;
|
||||||
extern crate generic_array;
|
extern crate generic_array;
|
||||||
extern crate digest;
|
extern crate digest;
|
||||||
extern crate subtle;
|
extern crate subtle;
|
||||||
|
extern crate failure;
|
||||||
|
|
||||||
#[cfg(feature = "std")]
|
#[cfg(feature = "std")]
|
||||||
extern crate rand;
|
extern crate rand;
|
||||||
|
|
|
||||||
Loading…
Reference in a new issue