diff --git a/modbus-mqtt/src/modbus/connection.rs b/modbus-mqtt/src/modbus/connection.rs index 72e624a..27045fa 100644 --- a/modbus-mqtt/src/modbus/connection.rs +++ b/modbus-mqtt/src/modbus/connection.rs @@ -60,12 +60,9 @@ pub(crate) async fn run( tokio::time::sleep(std::time::Duration::from_secs(current_wait as u64)) .await; - match conn { - Connection { rx: r, tx: t, .. } => { - rx = r; - tx = t; - } - }; + let Connection { rx: r, tx: t, .. } = conn; + rx = r; + tx = t; current_wait = (current_wait * 2).clamp(START_WAIT, MAX_WAIT); } else { // we are shutting down here, so don't care if this fails diff --git a/modbus-mqtt/src/modbus/register.rs b/modbus-mqtt/src/modbus/register.rs index 53b114b..1636a59 100644 --- a/modbus-mqtt/src/modbus/register.rs +++ b/modbus-mqtt/src/modbus/register.rs @@ -95,7 +95,7 @@ pub(crate) async fn subscribe(mqtt: &mqtt::Handle) -> crate::Result