@@ -2,7 +2,7 @@ use crate::{SpirvBuilder, SpirvBuilderError, leaf_deps};
22use notify:: { Event , RecommendedWatcher , RecursiveMode , Watcher } ;
33use rustc_codegen_spirv_types:: CompileResult ;
44use std:: path:: Path ;
5- use std:: sync:: mpsc:: { TryRecvError , TrySendError } ;
5+ use std:: sync:: mpsc:: TryRecvError ;
66use std:: {
77 collections:: HashSet ,
88 path:: PathBuf ,
@@ -67,14 +67,12 @@ impl SpirvWatcher {
6767 | notify:: EventKind :: Create ( _)
6868 | notify:: EventKind :: Modify ( _)
6969 | 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 ( _) => ( ) ,
7876 } ,
7977 Err ( err) => log:: error!( "notify error: {err:?}" ) ,
8078 } )
@@ -95,7 +93,7 @@ impl SpirvWatcher {
9593 ///
9694 /// See [`Self::try_recv`] for a non-blocking variant.
9795 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) )
9997 . map ( |result| result. unwrap ( ) )
10098 }
10199
0 commit comments