Skip to content

Commit

Permalink
fix: cargo fmt
Browse files Browse the repository at this point in the history
  • Loading branch information
rfdonnelly committed Aug 1, 2023
1 parent bedb339 commit 0758da3
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 18 deletions.
21 changes: 4 additions & 17 deletions src/cli.rs
Original file line number Diff line number Diff line change
Expand Up @@ -124,9 +124,7 @@ impl Cli {
fn check_windows_virtuals(&self) -> AppResult<()> {
#[cfg(not(unix))]
if !self.virtuals.is_empty() {
Err(anyhow!(
"the --virtual option is not available on Windows"
))
Err(anyhow!("the --virtual option is not available on Windows"))
} else {
Ok(())
}
Expand All @@ -145,14 +143,11 @@ impl Cli {
};
let physical_ids = self.physicals.iter().map(|physical| physical.id.as_str());

virtual_ids
.chain(physical_ids)
virtual_ids.chain(physical_ids)
}

fn check_route_ids(&self) -> AppResult<()> {
let ids = self
.ids()
.collect::<Vec<&str>>();
let ids = self.ids().collect::<Vec<&str>>();

for route in &self.routes {
if !ids.contains(&route.src.as_str()) {
Expand Down Expand Up @@ -184,15 +179,7 @@ impl Cli {
map
})
.iter()
.filter_map(
|(&id, &count)| {
if count > 1 {
Some(id)
} else {
None
}
},
)
.filter_map(|(&id, &count)| if count > 1 { Some(id) } else { None })
.collect::<Vec<&str>>();

if !duplicate_ids.is_empty() {
Expand Down
2 changes: 1 addition & 1 deletion src/lib.rs
Original file line number Diff line number Diff line change
@@ -1,9 +1,9 @@
use camino::{Utf8Path, Utf8PathBuf};
use thiserror::Error;
use tokio::io::{AsyncRead, AsyncWrite, AsyncWriteExt};
use tokio_serial::SerialPortBuilderExt;
#[cfg(unix)]
use tokio_serial::SerialPort;
use tokio_serial::SerialPortBuilderExt;
use tokio_serial::SerialStream;
use tokio_stream::{StreamExt, StreamMap};
use tokio_util::io::ReaderStream;
Expand Down

0 comments on commit 0758da3

Please sign in to comment.