Skip to content

Commit

Permalink
Rust formatting
Browse files Browse the repository at this point in the history
  • Loading branch information
mthmulders committed Nov 20, 2023
1 parent cfc82de commit a74eaf1
Show file tree
Hide file tree
Showing 2 changed files with 3 additions and 5 deletions.
6 changes: 2 additions & 4 deletions src/dsmr/reader.rs
Original file line number Diff line number Diff line change
Expand Up @@ -98,7 +98,7 @@ pub fn read_from_serial_port(
let error = result.expect_err("Expected an error, but there is none?");
log::info!("Read error {}, clearing buffer", error.to_string());
// Just drop this telegram
buffer.clear();
buffer.clear();
} else {
let clone = buffer.clone();

Expand All @@ -113,9 +113,7 @@ pub fn read_from_serial_port(
}
}

pub fn connect_to_meter(
serial_settings: settings::SerialSettings,
) -> Box<dyn SerialPort> {
pub fn connect_to_meter(serial_settings: settings::SerialSettings) -> Box<dyn SerialPort> {
log::info!(
"Connecting to {} using baud rate {}, byte size {} and parity bit {:#?}",
&serial_settings.port,
Expand Down
2 changes: 1 addition & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -51,7 +51,7 @@ pub fn main() {
log::info!("dsmr-rs starting...");
let (serial_settings, api_settings) = dsmr::settings::settings(settings).unwrap();
let mut consumer = dsmr::sender::DelegatingConsumer::new(api_settings.hosts);

let port: Box<dyn SerialPort> = dsmr::reader::connect_to_meter(serial_settings);

dsmr::reader::read_from_serial_port(port, &mut consumer);
Expand Down

0 comments on commit a74eaf1

Please sign in to comment.