Skip to content

Commit e311cc0

Browse files
committed
Fix: Rust lints.
1 parent 246829c commit e311cc0

File tree

2 files changed

+16
-16
lines changed

2 files changed

+16
-16
lines changed

server/src/ide/filewatcher.rs

Lines changed: 12 additions & 12 deletions
Original file line numberDiff line numberDiff 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());

server/src/main.rs

Lines changed: 4 additions & 4 deletions
Original file line numberDiff line numberDiff 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
}

0 commit comments

Comments
 (0)