Skip to content

Commit

Permalink
chore: make clippy happy
Browse files Browse the repository at this point in the history
Signed-off-by: Gabriele Baldoni <[email protected]>
  • Loading branch information
gabrik committed Dec 10, 2024
1 parent 4645c3a commit 989edb8
Show file tree
Hide file tree
Showing 2 changed files with 4 additions and 4 deletions.
2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -29,7 +29,7 @@ readme = "README.md"
# See more keys and their definitions at https://doc.rust-lang.org/cargo/reference/manifest.html

[dependencies]
tokio = {version = "1.17.0", features = ["io-util", "time"] }
tokio = {version = "1.17.0", features = ["io-util", "time", "fs"] }
tokio-serial = "5.4.1"
futures = "0.3.21"
cobs = "0.2"
Expand Down
6 changes: 3 additions & 3 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -427,14 +427,14 @@ impl ZSerial {

async fn check_device(&self) -> tokio_serial::Result<()> {
// check if the file is still there
if !tokio::fs::metadata(self.port.clone()).await.is_ok() {
if tokio::fs::metadata(self.port.clone()).await.is_err() {
// the file does not exist anymore returing an error
return Err(tokio_serial::Error::new(
tokio_serial::ErrorKind::NoDevice,
format!("Serial device disappeared"),
"Serial device disappeared".to_string(),
));
}
return Ok(());
Ok(())
}
async fn internal_read(&mut self, buff: &mut [u8]) -> tokio_serial::Result<(usize, Header)> {
//check if the device is sitll there
Expand Down

0 comments on commit 989edb8

Please sign in to comment.