From 4e04d132153f8b374fef7dad7738a556853a5b0a Mon Sep 17 00:00:00 2001 From: himself65 Date: Mon, 9 Aug 2021 15:57:53 +0800 Subject: [PATCH] Fix return out of match pattern --- src/walk.rs | 22 ++++++++-------------- 1 file changed, 8 insertions(+), 14 deletions(-) diff --git a/src/walk.rs b/src/walk.rs index 0529191..a073873 100644 --- a/src/walk.rs +++ b/src/walk.rs @@ -358,27 +358,21 @@ fn spawn_senders( DirEntry::BrokenSymlink(path) } _ => { - match tx_thread.send(WorkerResult::Error(ignore::Error::WithPath { + return match tx_thread.send(WorkerResult::Error(ignore::Error::WithPath { path, err: inner_err, })) { - Ok(_) => { - return ignore::WalkState::Continue; - } - Err(_) => { - return ignore::WalkState::Quit; - } + Ok(_) => ignore::WalkState::Continue, + Err(_) => ignore::WalkState::Quit, } } }, - Err(err) => match tx_thread.send(WorkerResult::Error(err)) { - Ok(_) => { - return ignore::WalkState::Continue; + Err(err) => { + return match tx_thread.send(WorkerResult::Error(err)) { + Ok(_) => ignore::WalkState::Continue, + Err(_) => ignore::WalkState::Quit, } - Err(_) => { - return ignore::WalkState::Quit; - } - }, + } }; if let Some(min_depth) = config.min_depth {