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

Commit d299f44

Browse files
committed
Replace empty match with pairs of functions
1 parent 345939d commit d299f44

File tree

2 files changed

+14
-8
lines changed

2 files changed

+14
-8
lines changed

src/error_chain.rs

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

src/lib.rs

Lines changed: 7 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -570,11 +570,15 @@ 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 = match () {
573+
self.0 = {
574574
#[cfg(not(has_error_source))]
575-
() => e.cause(),
575+
{
576+
e.cause()
577+
}
576578
#[cfg(has_error_source)]
577-
() => e.source(),
579+
{
580+
e.source()
581+
}
578582
};
579583
Some(e)
580584
}

0 commit comments

Comments
 (0)