Skip to content

Commit 81587ba

Browse files
committed
Fix clippy::single_match warning
``` error: you seem to be trying to use `match` for destructuring a single pattern. Consider using `if let` --> futures-executor/src/thread_pool.rs:349:9 | 349 | / match arc_self.mutex.notify() { 350 | | Ok(task) => arc_self.exec.state.send(Message::Run(task)), 351 | | Err(()) => {} 352 | | } | |_________^ help: try this: `if let Ok(task) = arc_self.mutex.notify() { arc_self.exec.state.send(Message::Run(task)) }` | = note: `-D clippy::single-match` implied by `-D warnings` = help: for further information visit https://rust-lang.github.io/rust-clippy/master/index.html#single_match ```
1 parent 07b741e commit 81587ba

File tree

1 file changed

+2
-3
lines changed

1 file changed

+2
-3
lines changed

futures-executor/src/thread_pool.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -346,9 +346,8 @@ impl fmt::Debug for Task {
346346

347347
impl ArcWake for WakeHandle {
348348
fn wake_by_ref(arc_self: &Arc<Self>) {
349-
match arc_self.mutex.notify() {
350-
Ok(task) => arc_self.exec.state.send(Message::Run(task)),
351-
Err(()) => {}
349+
if let Ok(task) = arc_self.mutex.notify() {
350+
arc_self.exec.state.send(Message::Run(task))
352351
}
353352
}
354353
}

0 commit comments

Comments
 (0)