Quit immediately if the channel::send call failed

This commit is contained in:
sharkdp 2019-12-20 19:27:10 +01:00 committed by David Peter
parent 762f551ff4
commit 0f27485faf

View file

@ -373,10 +373,12 @@ fn spawn_senders(
}
}
// TODO: take care of the unwrap call
tx_thread
.send(WorkerResult::Entry(entry_path.to_owned()))
.unwrap();
let send_result = tx_thread
.send(WorkerResult::Entry(entry_path.to_owned()));
if !send_result.is_ok() {
return ignore::WalkState::Quit;
}
ignore::WalkState::Continue
})