Skip to content

Commit 81c1c87

Browse files
committed
revert displaydoc removal
1 parent 3d039d0 commit 81c1c87

File tree

2 files changed

+2
-17
lines changed

2 files changed

+2
-17
lines changed

Cargo.toml

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -27,6 +27,7 @@ curve25519-dalek = { version = "4", default-features = false, features = [
2727
], optional = true }
2828
derive-where = { version = "1", features = ["zeroize-on-drop"] }
2929
digest = "0.10"
30+
displaydoc = { version = "0.2", default-features = false }
3031
elliptic-curve = { version = "0.13", features = [
3132
"hash2curve",
3233
"sec1",

src/error.rs

Lines changed: 1 addition & 17 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@
1212
pub type Result<T, E = Error> = core::result::Result<T, E>;
1313

1414
/// Represents an error in the manipulation of internal cryptographic data
15-
#[derive(Clone, Copy, Debug, Eq, Hash, Ord, PartialEq, PartialOrd)]
15+
#[derive(Clone, Copy, Debug, displaydoc::Display, Eq, Hash, Ord, PartialEq, PartialOrd)]
1616
pub enum Error {
1717
/// Size of info is longer then [`u16::MAX`].
1818
Info,
@@ -40,19 +40,3 @@ pub enum InternalError {
4040
}
4141

4242
impl core::error::Error for Error {}
43-
44-
impl core::fmt::Display for Error {
45-
fn fmt(&self, f: &mut core::fmt::Formatter<'_>) -> core::fmt::Result {
46-
let message = match self {
47-
Self::Info => "Size of info is longer then u16::MAX.",
48-
Self::Input => "Size of input is empty or longer then u16::MAX.",
49-
Self::DeriveKeyPair => "Size of info and seed together are longer then u16::MAX - 3.",
50-
Self::Deserialization => "Failure to deserialize bytes.",
51-
Self::Batch => "Batched items are more then u16::MAX or length don't match.",
52-
Self::ProofVerification => "In verifiable mode, occurs when the proof failed to verify.",
53-
Self::Protocol => "The protocol has failed and can't be completed.",
54-
};
55-
56-
f.write_str(message)
57-
}
58-
}

0 commit comments

Comments
 (0)