@@ -2,7 +2,7 @@ use crate::{SpirvBuilder, SpirvBuilderError, leaf_deps};
2
2
use notify:: { Event , RecommendedWatcher , RecursiveMode , Watcher } ;
3
3
use rustc_codegen_spirv_types:: CompileResult ;
4
4
use std:: path:: Path ;
5
- use std:: sync:: mpsc:: { TryRecvError , TrySendError } ;
5
+ use std:: sync:: mpsc:: TryRecvError ;
6
6
use std:: {
7
7
collections:: HashSet ,
8
8
path:: PathBuf ,
@@ -67,14 +67,12 @@ impl SpirvWatcher {
67
67
| notify:: EventKind :: Create ( _)
68
68
| notify:: EventKind :: Modify ( _)
69
69
| notify:: EventKind :: Remove ( _)
70
- | notify:: EventKind :: Other => match tx. try_send ( ( ) ) {
71
- Ok ( _) => ( ) ,
72
- // disconnect is fine, SpirvWatcher is currently dropping
73
- Err ( TrySendError :: Disconnected ( _) ) => ( ) ,
74
- // full is fine, we just need to send a single event anyway
75
- Err ( TrySendError :: Full ( _) ) => ( ) ,
76
- } ,
77
- notify:: EventKind :: Access ( _) => { }
70
+ | notify:: EventKind :: Other => {
71
+ // `Err(Disconnected)` is fine, SpirvWatcher is currently dropping
72
+ // `Err(Full)` is fine, we just need to send a single event anyway
73
+ tx. try_send ( ( ) ) . ok ( ) ;
74
+ }
75
+ notify:: EventKind :: Access ( _) => ( ) ,
78
76
} ,
79
77
Err ( err) => log:: error!( "notify error: {err:?}" ) ,
80
78
} )
@@ -95,7 +93,7 @@ impl SpirvWatcher {
95
93
///
96
94
/// See [`Self::try_recv`] for a non-blocking variant.
97
95
pub fn recv ( & mut self ) -> Result < CompileResult , SpirvBuilderError > {
98
- self . recv_inner ( |rx| rx. recv ( ) . map_err ( |err| TryRecvError :: from ( err ) ) )
96
+ self . recv_inner ( |rx| rx. recv ( ) . map_err ( TryRecvError :: from) )
99
97
. map ( |result| result. unwrap ( ) )
100
98
}
101
99
0 commit comments