Skip to content

Commit 6f88f36

Browse files
committed
Fix clippy errors
1 parent 85c8eb8 commit 6f88f36

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

espflash/src/cli/serial.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -25,7 +25,7 @@ pub fn get_serial_port_info(
2525
find_serial_port(&ports, serial.to_owned())
2626
} else if let Some(serial) = &config.connection.serial {
2727
find_serial_port(&ports, serial.to_owned())
28-
} else if ports.len() > 0 {
28+
} else if !ports.is_empty() {
2929
let (port, matches) = select_serial_port(ports, config)?;
3030
match &port.port_type {
3131
SerialPortType::UsbPort(usb_info) if !matches => {
@@ -61,7 +61,7 @@ pub fn get_serial_port_info(
6161

6262
/// Given a vector of `SerialPortInfo` structs, attempt to find and return one
6363
/// whose `port_name` field matches the provided `name` argument.
64-
fn find_serial_port(ports: &Vec<SerialPortInfo>, name: String) -> Option<SerialPortInfo> {
64+
fn find_serial_port(ports: &[SerialPortInfo], name: String) -> Option<SerialPortInfo> {
6565
ports
6666
.iter()
6767
.find(|port| port.port_name == name)

0 commit comments

Comments
 (0)