File tree Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Expand file tree Collapse file tree 2 files changed +3
-5
lines changed Original file line number Diff line number Diff line change @@ -18,10 +18,8 @@ fn main() {
1818 let duration = std:: time:: Duration :: from_secs ( 1 ) ;
1919 match receiver. recv_timeout ( duration) {
2020 Ok ( val) => println ! ( "{:?}" , val) ,
21- Err ( e) => match e {
22- std:: sync:: mpsc:: RecvTimeoutError :: Disconnected => break ,
23- _ => { } // This is the case where nothing entered the channel buffer (no file mods).
24- } ,
21+ // This is the case where nothing entered the channel buffer (no file mods).
22+ Err ( e) => if e == std:: sync:: mpsc:: RecvTimeoutError :: Disconnected { break } ,
2523 }
2624 }
2725
Original file line number Diff line number Diff line change @@ -229,6 +229,7 @@ fn internal_validate_watch_single_file(run_async: bool) {
229229 let mut file = OpenOptions :: new ( )
230230 . write ( true )
231231 . create ( true )
232+ . truncate ( true )
232233 . open ( dst. as_path ( ) )
233234 . unwrap ( ) ;
234235 file. write_all ( b"create" ) . unwrap ( ) ;
@@ -238,7 +239,6 @@ fn internal_validate_watch_single_file(run_async: bool) {
238239 // Wait a bit then modify
239240 thread:: sleep ( Duration :: from_millis ( 100 ) ) ;
240241 let mut file = OpenOptions :: new ( )
241- . write ( true )
242242 . append ( true )
243243 . open ( dst. as_path ( ) )
244244 . unwrap ( ) ;
You can’t perform that action at this time.
0 commit comments