Skip to content

Commit dd0b2d5

Browse files
authored
Merge pull request #21 from dalek-cryptography/thiserror
Move from failure to thiserror.
2 parents 15a2269 + a5a9d2a commit dd0b2d5

File tree

3 files changed

+7
-11
lines changed

3 files changed

+7
-11
lines changed

Cargo.toml

Lines changed: 3 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,9 @@ features = ["nightly"]
2020
[dependencies]
2121
merlin = "2"
2222
rand = "0.7"
23-
serde = "1.0"
24-
serde_derive = "1.0"
25-
failure = "0.1.5"
26-
failure_derive = "0.1.5"
23+
serde = "1"
24+
serde_derive = "1"
25+
thiserror = "1"
2726
curve25519-dalek = { version = "2", features = ["serde"] }
2827

2928
[dev-dependencies]

src/errors.rs

Lines changed: 4 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -1,10 +1,11 @@
1+
use thiserror::Error;
12
/// An error during proving or verification, such as a verification failure.
2-
#[derive(Debug, Fail)]
3+
#[derive(Debug, Error)]
34
pub enum ProofError {
45
/// Something is wrong with the proof, causing a verification failure.
5-
#[fail(display = "Verification failed.")]
6+
#[error("Verification failed.")]
67
VerificationFailure,
78
/// Occurs during batch verification if the batch parameters are mis-sized.
8-
#[fail(display = "Mismatched parameter sizes for batch verification.")]
9+
#[error("Mismatched parameter sizes for batch verification.")]
910
BatchSizeMismatch,
1011
}

src/lib.rs

Lines changed: 0 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -20,10 +20,6 @@
2020
//! Docs will only build on nightly Rust until
2121
//! [RFC 1990 stabilizes](https://github.com/rust-lang/rust/issues/44732).
2222
23-
extern crate failure;
24-
#[macro_use]
25-
extern crate failure_derive;
26-
2723
extern crate serde;
2824

2925
#[doc(hidden)]

0 commit comments

Comments
 (0)