File tree Expand file tree Collapse file tree 2 files changed +16
-16
lines changed
Expand file tree Collapse file tree 2 files changed +16
-16
lines changed Original file line number Diff line number Diff line change @@ -410,11 +410,11 @@ async fn processing_task(
410410 error ! ( "Unable to create debouncer." ) ;
411411 return ;
412412 } ;
413- if let Some ( ref cfp) = current_filepath {
414- if let Err ( err) = debounced_watcher. watch ( cfp, RecursiveMode :: NonRecursive ) {
415- error ! ( "Unable to watch file: {err}" ) ;
416- return ;
417- } ;
413+ if let Some ( ref cfp) = current_filepath
414+ && let Err ( err) = debounced_watcher. watch ( cfp, RecursiveMode :: NonRecursive )
415+ {
416+ error ! ( "Unable to watch file: {err}" ) ;
417+ return ;
418418 }
419419
420420 ' task: {
@@ -613,13 +613,13 @@ async fn processing_task(
613613 Ok ( ref file_path) => ' err_exit: {
614614 // We finally have the desired path! First,
615615 // unwatch the old path.
616- if let Some ( cfp) = & current_filepath {
617- if let Err ( err) = debounced_watcher. unwatch( cfp) {
618- break ' err_exit Err ( format! (
619- "Unable to unwatch file '{}': {err}." ,
620- cfp . to_string_lossy ( )
621- ) ) ;
622- } ;
616+ if let Some ( cfp) = & current_filepath
617+ && let Err ( err) = debounced_watcher. unwatch( cfp)
618+ {
619+ break ' err_exit Err ( format! (
620+ "Unable to unwatch file '{}': {err}." ,
621+ cfp . to_string_lossy ( )
622+ ) ) ;
623623 }
624624 // Update to the new path.
625625 current_filepath = Some ( file_path. to_path_buf( ) ) ;
Original file line number Diff line number Diff line change @@ -157,10 +157,10 @@ impl Cli {
157157 // statement.
158158 ' err_print: {
159159 // Ignore a connection refused error.
160- if let minreq:: Error :: IoError ( io_error) = & err {
161- if io_error. kind ( ) == io:: ErrorKind :: ConnectionRefused {
162- break ' err_print ;
163- }
160+ if let minreq:: Error :: IoError ( io_error) = & err
161+ && io_error. kind ( ) == io:: ErrorKind :: ConnectionRefused
162+ {
163+ break ' err_print ;
164164 }
165165 eprintln ! ( "Failed to connect to server at {addr}: {err}" ) ;
166166 }
You can’t perform that action at this time.
0 commit comments