Skip to content

Commit 1819f9e

Browse files
committed
cargo fmt
1 parent 53a884a commit 1819f9e

1 file changed

Lines changed: 14 additions & 7 deletions

File tree

src/main.rs

Lines changed: 14 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -19,8 +19,8 @@ use std::sync::{
1919
Arc, Mutex as StdMutex,
2020
atomic::{AtomicBool, Ordering},
2121
};
22-
use tokio::sync::{Mutex, mpsc};
2322
use std::time::Duration;
23+
use tokio::sync::{Mutex, mpsc};
2424

2525
/// Which line ending to send when you press Enter
2626
#[derive(Copy, Clone, Debug, ValueEnum)]
@@ -249,7 +249,8 @@ async fn main() -> Result<()> {
249249

250250
// Handle Ctrl-C with immediate shutdown
251251
let running = Arc::new(AtomicBool::new(true));
252-
let shutdown_tx: Arc<StdMutex<Option<mpsc::UnboundedSender<UiMessage>>>> = Arc::new(StdMutex::new(None));
252+
let shutdown_tx: Arc<StdMutex<Option<mpsc::UnboundedSender<UiMessage>>>> =
253+
Arc::new(StdMutex::new(None));
253254
{
254255
let running = running.clone();
255256
let shutdown_tx = shutdown_tx.clone();
@@ -367,7 +368,8 @@ async fn main() -> Result<()> {
367368
tx_log: tx_log_writer.clone(),
368369
log_ts: args.log_ts,
369370
},
370-
).await;
371+
)
372+
.await;
371373

372374
// Cleanup terminal
373375
terminal::disable_raw_mode()?;
@@ -487,13 +489,15 @@ impl AppState {
487489
fn add_output(&mut self, data: String) {
488490
// Append to partial line buffer
489491
self.partial_line.push_str(&data);
490-
492+
491493
// Check if we have complete lines (ending with \n or \r\n)
492494
while let Some(newline_pos) = self.partial_line.find('\n') {
493495
// Extract complete line (without the newline)
494-
let complete_line = self.partial_line[..newline_pos].trim_end_matches('\r').to_string();
496+
let complete_line = self.partial_line[..newline_pos]
497+
.trim_end_matches('\r')
498+
.to_string();
495499
self.output_lines.push(complete_line);
496-
500+
497501
// Remove processed part from partial_line
498502
self.partial_line.drain(..=newline_pos);
499503
}
@@ -774,7 +778,10 @@ fn draw_ui(f: &mut Frame, app_state: &mut AppState) {
774778
));
775779
}
776780

777-
async fn write_bytes_async(port: &Arc<Mutex<Box<dyn SerialPort + Send>>>, bytes: &[u8]) -> Result<()> {
781+
async fn write_bytes_async(
782+
port: &Arc<Mutex<Box<dyn SerialPort + Send>>>,
783+
bytes: &[u8],
784+
) -> Result<()> {
778785
let mut guard = port.lock().await;
779786
guard.write_all(bytes)?;
780787
guard.flush()?;

0 commit comments

Comments
 (0)