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(
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)
You can’t perform that action at this time.
0 commit comments