Skip to content

Commit aefe49e

Browse files
committed
watch: fix clippy
1 parent a46522e commit aefe49e

File tree

1 file changed

+8
-10
lines changed

1 file changed

+8
-10
lines changed

crates/spirv-builder/src/watch.rs

Lines changed: 8 additions & 10 deletions
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@ use crate::{SpirvBuilder, SpirvBuilderError, leaf_deps};
22
use notify::{Event, RecommendedWatcher, RecursiveMode, Watcher};
33
use rustc_codegen_spirv_types::CompileResult;
44
use std::path::Path;
5-
use std::sync::mpsc::{TryRecvError, TrySendError};
5+
use std::sync::mpsc::TryRecvError;
66
use std::{
77
collections::HashSet,
88
path::PathBuf,
@@ -69,14 +69,12 @@ impl SpirvWatcher {
6969
| notify::EventKind::Create(_)
7070
| notify::EventKind::Modify(_)
7171
| notify::EventKind::Remove(_)
72-
| notify::EventKind::Other => match tx.try_send(()) {
73-
Ok(_) => (),
74-
// disconnect is fine, SpirvWatcher is currently dropping
75-
Err(TrySendError::Disconnected(_)) => (),
76-
// full is fine, we just need to send a single event anyway
77-
Err(TrySendError::Full(_)) => (),
78-
},
79-
notify::EventKind::Access(_) => {}
72+
| notify::EventKind::Other => {
73+
// `Err(Disconnected)` is fine, SpirvWatcher is currently dropping
74+
// `Err(Full)` is fine, we just need to send a single event anyway
75+
tx.try_send(()).ok();
76+
}
77+
notify::EventKind::Access(_) => (),
8078
},
8179
Err(err) => log::error!("notify error: {err:?}"),
8280
})
@@ -97,7 +95,7 @@ impl SpirvWatcher {
9795
///
9896
/// See [`Self::try_recv`] for a non-blocking variant.
9997
pub fn recv(&mut self) -> Result<CompileResult, SpirvBuilderError> {
100-
self.recv_inner(|rx| rx.recv().map_err(|err| TryRecvError::from(err)))
98+
self.recv_inner(|rx| rx.recv().map_err(TryRecvError::from))
10199
.map(|result| result.unwrap())
102100
}
103101

0 commit comments

Comments
 (0)