Skip to content

Commit

Permalink
Fix Clippy warning
Browse files Browse the repository at this point in the history
  • Loading branch information
mthmulders committed Nov 20, 2023
1 parent a74eaf1 commit c35dabb
Showing 1 changed file with 2 additions and 2 deletions.
4 changes: 2 additions & 2 deletions src/dsmr/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -122,14 +122,14 @@ pub fn connect_to_meter(serial_settings: settings::SerialSettings) -> Box<dyn Se
&serial_settings.parity_bit
);

return serialport::new(&serial_settings.port, serial_settings.baud_rate)
serialport::new(&serial_settings.port, serial_settings.baud_rate)
.data_bits(to_databits(&serial_settings.byte_size))
.flow_control(serialport::FlowControl::None)
.parity(to_serial_port_parity_bit(&serial_settings.parity_bit))
.stop_bits(serialport::StopBits::One)
.timeout(Duration::from_secs(20))
.open()
.expect("Failed to open port");
.expect("Failed to open port")
}

fn to_serial_port_parity_bit(input: &ParityBitSetting) -> serialport::Parity {
Expand Down

0 comments on commit c35dabb

Please sign in to comment.