|
3 | 3 | #![no_std]
|
4 | 4 | #![forbid(unused_crate_dependencies, missing_docs)]
|
5 | 5 |
|
6 |
| -#[cfg(any(feature = "std", test))] |
| 6 | +#[cfg(test)] |
7 | 7 | extern crate std;
|
8 | 8 |
|
9 | 9 | extern crate alloc;
|
10 | 10 |
|
11 | 11 | mod _unused_deps {
|
12 |
| - // We don't use it directy, but we need to enable `serde` feature |
| 12 | + // We don't use it directly, but we need to enable `serde` feature |
13 | 13 | use generic_array as _;
|
14 | 14 | }
|
15 | 15 |
|
@@ -132,28 +132,23 @@ where
|
132 | 132 | }
|
133 | 133 |
|
134 | 134 | /// Protocol error
|
135 |
| -#[derive(Debug, displaydoc::Display)] |
136 |
| -#[cfg_attr(feature = "std", derive(thiserror::Error))] |
| 135 | +#[derive(Debug, thiserror::Error)] |
137 | 136 | pub enum Error<RecvErr, SendErr> {
|
138 | 137 | /// Couldn't send a message in the first round
|
139 |
| - #[displaydoc("send a message at round 1")] |
140 |
| - Round1Send(#[cfg_attr(feature = "std", source)] SendErr), |
| 138 | + #[error("send a message at round 1")] |
| 139 | + Round1Send(#[source] SendErr), |
141 | 140 | /// Couldn't receive a message in the first round
|
142 |
| - #[displaydoc("receive messages at round 1")] |
143 |
| - Round1Receive( |
144 |
| - #[cfg_attr(feature = "std", source)] CompleteRoundError<RoundInputError, RecvErr>, |
145 |
| - ), |
| 141 | + #[error("receive messages at round 1")] |
| 142 | + Round1Receive(#[source] CompleteRoundError<RoundInputError, RecvErr>), |
146 | 143 | /// Couldn't send a message in the second round
|
147 |
| - #[displaydoc("send a message at round 2")] |
148 |
| - Round2Send(#[cfg_attr(feature = "std", source)] SendErr), |
| 144 | + #[error("send a message at round 2")] |
| 145 | + Round2Send(#[source] SendErr), |
149 | 146 | /// Couldn't receive a message in the second round
|
150 |
| - #[displaydoc("receive messages at round 2")] |
151 |
| - Round2Receive( |
152 |
| - #[cfg_attr(feature = "std", source)] CompleteRoundError<RoundInputError, RecvErr>, |
153 |
| - ), |
| 147 | + #[error("receive messages at round 2")] |
| 148 | + Round2Receive(#[source] CompleteRoundError<RoundInputError, RecvErr>), |
154 | 149 |
|
155 | 150 | /// Some of the parties cheated
|
156 |
| - #[displaydoc("malicious parties: {guilty_parties:?}")] |
| 151 | + #[error("malicious parties: {guilty_parties:?}")] |
157 | 152 | PartiesOpenedRandomnessDoesntMatchCommitment {
|
158 | 153 | /// List of cheated parties
|
159 | 154 | guilty_parties: Vec<Blame>,
|
|
0 commit comments