File tree Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Expand file tree Collapse file tree 1 file changed +2
-2
lines changed Original file line number Diff line number Diff line change @@ -25,7 +25,7 @@ pub fn get_serial_port_info(
25
25
find_serial_port ( & ports, serial. to_owned ( ) )
26
26
} else if let Some ( serial) = & config. connection . serial {
27
27
find_serial_port ( & ports, serial. to_owned ( ) )
28
- } else if ports. len ( ) > 0 {
28
+ } else if ! ports. is_empty ( ) {
29
29
let ( port, matches) = select_serial_port ( ports, config) ?;
30
30
match & port. port_type {
31
31
SerialPortType :: UsbPort ( usb_info) if !matches => {
@@ -61,7 +61,7 @@ pub fn get_serial_port_info(
61
61
62
62
/// Given a vector of `SerialPortInfo` structs, attempt to find and return one
63
63
/// 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 > {
65
65
ports
66
66
. iter ( )
67
67
. find ( |port| port. port_name == name)
You can’t perform that action at this time.
0 commit comments