@@ -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 ,
@@ -69,14 +69,12 @@ impl SpirvWatcher {
69
69
| notify:: EventKind :: Create ( _)
70
70
| notify:: EventKind :: Modify ( _)
71
71
| 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 ( _) => ( ) ,
80
78
} ,
81
79
Err ( err) => log:: error!( "notify error: {err:?}" ) ,
82
80
} )
@@ -97,7 +95,7 @@ impl SpirvWatcher {
97
95
///
98
96
/// See [`Self::try_recv`] for a non-blocking variant.
99
97
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) )
101
99
. map ( |result| result. unwrap ( ) )
102
100
}
103
101
0 commit comments