Skip to content

Commit 98b84af

Browse files
committed
clippy fix
1 parent 1819f9e commit 98b84af

1 file changed

Lines changed: 5 additions & 7 deletions

File tree

src/main.rs

Lines changed: 5 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -322,8 +322,8 @@ async fn main() -> Result<()> {
322322
let _ = serial_tx_clone.send(SerialData::Received(display_text));
323323

324324
// RX log file
325-
if let Some(w) = &rx_log_writer_reader {
326-
if let Ok(mut lw) = w.lock() {
325+
if let Some(w) = &rx_log_writer_reader
326+
&& let Ok(mut lw) = w.lock() {
327327
if log_ts {
328328
let _ = write!(lw, "[{}] ", now_rfc3339());
329329
}
@@ -342,7 +342,6 @@ async fn main() -> Result<()> {
342342
}
343343
let _ = lw.flush();
344344
}
345-
}
346345
} else {
347346
// Small async yield to prevent busy waiting
348347
tokio::task::yield_now().await;
@@ -616,11 +615,11 @@ async fn run_ui<B: Backend>(
616615
event::read()
617616
} else {
618617
tokio::time::sleep(Duration::from_millis(1)).await;
619-
return Err(std::io::Error::new(std::io::ErrorKind::WouldBlock, "no input"));
618+
Err(std::io::Error::new(std::io::ErrorKind::WouldBlock, "no input"))
620619
}
621620
} => {
622-
if let Ok(Event::Key(k)) = key_result {
623-
if k.kind == KeyEventKind::Press {
621+
if let Ok(Event::Key(k)) = key_result
622+
&& k.kind == KeyEventKind::Press {
624623
match k.code {
625624
KeyCode::Char(c)
626625
if k.modifiers.contains(KeyModifiers::CONTROL)
@@ -712,7 +711,6 @@ async fn run_ui<B: Backend>(
712711
_ => {}
713712
}
714713
}
715-
}
716714
}
717715
}
718716

0 commit comments

Comments
 (0)