|
12 | 12 | pub type Result<T, E = Error> = core::result::Result<T, E>; |
13 | 13 |
|
14 | 14 | /// 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)] |
16 | 16 | pub enum Error { |
17 | 17 | /// Size of info is longer then [`u16::MAX`]. |
18 | 18 | Info, |
@@ -40,19 +40,3 @@ pub enum InternalError { |
40 | 40 | } |
41 | 41 |
|
42 | 42 | 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