diff --git a/src/codec/mod.rs b/src/codec/mod.rs
index d6808b5..aaa17ff 100644
--- a/src/codec/mod.rs
+++ b/src/codec/mod.rs
@@ -138,7 +138,7 @@ impl<'r> TryFrom<&'r [u8]> for Request<'r> {
return Err(Error::ByteCount(write_count));
}
let data = Data {
- quantity: write_quantity as usize,
+ quantity: write_quantity,
data: &bytes[10..10 + write_count as usize],
};
ReadWriteMultipleRegisters(read_address, read_quantity, write_address, data)
diff --git a/src/codec/rtu/mod.rs b/src/codec/rtu/mod.rs
index a2e0eac..fa18874 100644
--- a/src/codec/rtu/mod.rs
+++ b/src/codec/rtu/mod.rs
@@ -69,14 +69,13 @@ pub fn decode(
Response => "response",
};
if drop_cnt + 1 >= MAX_FRAME_LEN {
- error!(
- "Giving up to decode frame after dropping {} byte(s): {:X?}",
- drop_cnt,
+ log::error!(
+ "Giving up to decode frame after dropping {drop_cnt} byte(s): {:X?}",
&buf[0..drop_cnt]
);
return Err(err);
}
- warn!("Failed to decode {} frame: {}", pdu_type, err);
+ log::warn!("Failed to decode {pdu_type} frame: {err}");
drop_cnt += 1;
retry = true;
Ok(None)
diff --git a/src/codec/rtu/server.rs b/src/codec/rtu/server.rs
index d3ff541..6a05909 100644
--- a/src/codec/rtu/server.rs
+++ b/src/codec/rtu/server.rs
@@ -15,7 +15,7 @@ pub fn decode_request(buf: &[u8]) -> Result