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

Commit 94e6540

Browse files
committed
Revert "Replace empty match with pairs of functions"
This broke 1.10 support This reverts commit d299f44.
1 parent c78ced2 commit 94e6540

File tree

2 files changed

+8
-14
lines changed

2 files changed

+8
-14
lines changed

src/error_chain.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -188,13 +188,11 @@ macro_rules! impl_error_chain_processed {
188188
$(
189189
$(#[$meta_foreign_links])*
190190
$error_kind_name::$foreign_link_variant(ref foreign_err) => {
191-
#[cfg(not(has_error_source))]
192-
{
193-
foreign_err.cause()
194-
}
195-
#[cfg(has_error_source)]
196-
{
197-
foreign_err.source()
191+
match () {
192+
#[cfg(not(has_error_source))]
193+
() => foreign_err.cause(),
194+
#[cfg(has_error_source)]
195+
() => foreign_err.source(),
198196
}
199197
}
200198
) *

src/lib.rs

Lines changed: 3 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -570,15 +570,11 @@ impl<'a> Iterator for Iter<'a> {
570570
fn next<'b>(&'b mut self) -> Option<&'a error::Error> {
571571
match self.0.take() {
572572
Some(e) => {
573-
self.0 = {
573+
self.0 = match () {
574574
#[cfg(not(has_error_source))]
575-
{
576-
e.cause()
577-
}
575+
() => e.cause(),
578576
#[cfg(has_error_source)]
579-
{
580-
e.source()
581-
}
577+
() => e.source(),
582578
};
583579
Some(e)
584580
}

0 commit comments

Comments
 (0)