Skip to content

Commit

Permalink
clippy lint
Browse files Browse the repository at this point in the history
  • Loading branch information
paultag committed Aug 23, 2024
1 parent 34578a1 commit fec71fa
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions src/usb/control.rs
Original file line number Diff line number Diff line change
Expand Up @@ -8,7 +8,6 @@ use std::sync::Arc;
use tokio::{
io::{AsyncBufReadExt, AsyncReadExt, AsyncWriteExt, ReadHalf, WriteHalf},
sync::Mutex,
task::JoinHandle,
};
use tokio_serial::SerialStream;

Expand Down Expand Up @@ -160,15 +159,15 @@ impl GcodeControlTrait for Usb {
self.wait_for_start().await?;

Check warning on line 159 in src/usb/control.rs

View check run for this annotation

Codecov / codecov/patch

src/usb/control.rs#L155-L159

Added lines #L155 - L159 were not covered by tests

let self1 = self.clone();
let _: JoinHandle<Result<()>> = tokio::spawn(async move {
tokio::spawn(async move {
let mut usb = self1;
for line in lines.iter() {
let msg = format!("{}\r\n", line);
println!("writing: {}", line);
usb.client.lock().await.write_all(msg.as_bytes()).await?;
usb.wait_for_ok().await?;

Check warning on line 168 in src/usb/control.rs

View check run for this annotation

Codecov / codecov/patch

src/usb/control.rs#L161-L168

Added lines #L161 - L168 were not covered by tests
}
Ok(())
Ok::<(), anyhow::Error>(())
});

// store a handle to the joinhandle in an option in self or something?
Expand Down

0 comments on commit fec71fa

Please sign in to comment.