Skip to content
This repository was archived by the owner on Aug 16, 2021. It is now read-only.

Commit 0bf2ff6

Browse files
committed
Limit to 1 the number of declarations of the same type.
1 parent f282be0 commit 0bf2ff6

File tree

3 files changed

+5
-6
lines changed

3 files changed

+5
-6
lines changed

CHANGELOG.md

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -11,6 +11,7 @@
1111
- The declarations order is more flexible.
1212
- Way better error reporting when there is a syntax error in the macro call.
1313
- `Result` generation can be disabled.
14+
- At most one declaration of each type can be present.
1415

1516
# 0.5.0
1617

src/error_chain.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -228,7 +228,7 @@ macro_rules! error_chain_processed {
228228
#[macro_export]
229229
macro_rules! error_chain_processing {
230230
(
231-
($a:tt, $b:tt, $c:tt, $d:tt)
231+
({}, $b:tt, $c:tt, $d:tt)
232232
types $content:tt
233233
$( $tail:tt )*
234234
) => {
@@ -238,7 +238,7 @@ macro_rules! error_chain_processing {
238238
}
239239
};
240240
(
241-
($a:tt, $b:tt, $c:tt, $d:tt)
241+
($a:tt, {}, $c:tt, $d:tt)
242242
links $content:tt
243243
$( $tail:tt )*
244244
) => {
@@ -248,7 +248,7 @@ macro_rules! error_chain_processing {
248248
}
249249
};
250250
(
251-
($a:tt, $b:tt, $c:tt, $d:tt)
251+
($a:tt, $b:tt, {}, $d:tt)
252252
foreign_links $content:tt
253253
$( $tail:tt )*
254254
) => {
@@ -258,7 +258,7 @@ macro_rules! error_chain_processing {
258258
}
259259
};
260260
(
261-
($a:tt, $b:tt, $c:tt, $d:tt)
261+
($a:tt, $b:tt, $c:tt, {})
262262
errors $content:tt
263263
$( $tail:tt )*
264264
) => {

tests/tests.rs

Lines changed: 0 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -120,8 +120,6 @@ fn smoke_test_8() {
120120

121121
errors {
122122
FileNotFound
123-
}
124-
errors {
125123
AccessDenied
126124
}
127125
};

0 commit comments

Comments
 (0)