diff --git a/fan-controller/src/main.rs b/fan-controller/src/main.rs index 3746248..dc9f9cf 100644 --- a/fan-controller/src/main.rs +++ b/fan-controller/src/main.rs @@ -706,7 +706,7 @@ async fn fan_control_routine( //TODO or provide a counter to detect the endless loop // There is no Option::copied or Option::cloned for some reason in core - current_set_point.inspect(|speed| other_fan_speed.signal(speed.clone())); + current_set_point.inspect(|speed| other_fan_speed.signal(*speed)); continue; } diff --git a/fan-controller/src/modbus/client.rs b/fan-controller/src/modbus/client.rs index 8535e3f..ff35a94 100644 --- a/fan-controller/src/modbus/client.rs +++ b/fan-controller/src/modbus/client.rs @@ -137,7 +137,7 @@ impl<'a, UART: uart::Instance, PIN: Pin> Client<'a, UART, PIN> { let bytes = message.as_ref(); info!("{} Sending message to fan: {:?}", fan_identifier, bytes); // As ref because &[u8; 8] is not the same as &[u8] - let result = with_timeout(configuration::FAN_TIMEOUT, self.uart.write_all(&bytes)).await?; + let result = with_timeout(configuration::FAN_TIMEOUT, self.uart.write_all(bytes)).await?; info!("{} UART write result: {:?}", fan_identifier, result); @@ -248,7 +248,7 @@ impl<'a, UART: uart::Instance, PIN: Pin> Client<'a, UART, PIN> { // Send update through UART to MAX845 to modbus fans // Form message to fan 1 let register_address = (*holding_registers::REFERENCE_SET_POINT).to_be_bytes(); - let value: u16 = set_point.deref().clone(); + let value: u16 = *set_point.deref(); let mut message: [u8; 8] = [ // Device address fan 1 *address::FAN_1, diff --git a/fan-controller/src/modbus/device.rs b/fan-controller/src/modbus/device.rs index 5028282..2ba04d2 100644 --- a/fan-controller/src/modbus/device.rs +++ b/fan-controller/src/modbus/device.rs @@ -10,9 +10,9 @@ mod address { } } - impl Into for Address { - fn into(self) -> u8 { - self.0 + impl From
for u8 { + fn from(value: Address) -> Self { + value.0 } } diff --git a/fan-controller/src/modbus/register.rs b/fan-controller/src/modbus/register.rs index 4543ded..b1e6873 100644 --- a/fan-controller/src/modbus/register.rs +++ b/fan-controller/src/modbus/register.rs @@ -10,9 +10,9 @@ mod address { } } - impl Into for Address { - fn into(self) -> u16 { - self.0 + impl From
for u16 { + fn from(value: Address) -> Self { + value.0 } }