Skip to content

Commit 3860c0c

Browse files
Merge pull request #95 from kacper-uminski/clippy
Fix default clippy lints.
2 parents b0b6605 + a358dd4 commit 3860c0c

File tree

3 files changed

+5
-8
lines changed

3 files changed

+5
-8
lines changed

src/dynamixel_protocol/mod.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -417,7 +417,7 @@ trait Protocol<P: Packet> {
417417
data.extend(header);
418418
data.extend(payload);
419419

420-
log::debug!("<<< {:?}", data);
420+
log::debug!("<<< {data:?}");
421421

422422
P::status_packet(&data, sender_id)
423423
}
@@ -430,7 +430,7 @@ trait Protocol<P: Packet> {
430430
fn flush(&self, port: &mut dyn SerialPort) -> Result<()> {
431431
let n = port.bytes_to_read()? as usize;
432432
if n > 0 {
433-
log::info!("Needed to flush serial port ({} bytes)...", n);
433+
log::info!("Needed to flush serial port ({n} bytes)...");
434434
let mut buff = vec![0u8; n];
435435
port.read_exact(&mut buff)?;
436436
}
@@ -463,7 +463,7 @@ impl fmt::Display for CommunicationErrorKind {
463463
CommunicationErrorKind::ParsingError => write!(f, "Parsing error"),
464464
CommunicationErrorKind::TimeoutError => write!(f, "Timeout error"),
465465
CommunicationErrorKind::IncorrectId(sender_id, resp_id) => {
466-
write!(f, "Incorrect id ({} instead of {})", resp_id, sender_id)
466+
write!(f, "Incorrect id ({resp_id} instead of {sender_id})")
467467
}
468468
CommunicationErrorKind::Unsupported => write!(f, "Operation not supported"),
469469
}

src/dynamixel_protocol/v1.rs

Lines changed: 1 addition & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -147,10 +147,7 @@ impl StatusPacket<PacketV1> for StatusPacketV1 {
147147
let read_crc = *data.last().unwrap();
148148
let computed_crc = crc(&data[2..data.len() - 1]);
149149
if read_crc != computed_crc {
150-
println!(
151-
"read crc: {}, computed crc: {} data: {:?}",
152-
read_crc, computed_crc, data
153-
);
150+
println!("read crc: {read_crc}, computed crc: {computed_crc} data: {data:?}");
154151

155152
return Err(Box::new(CommunicationErrorKind::ChecksumError));
156153
}

src/servo/orbita/orbita3d_poulpe.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -30,12 +30,12 @@ pub struct Vec3d<T> {
3030
/// Wrapper for a Position/Speed/Load value for each motor
3131
#[derive(Clone, Copy, Debug)]
3232
#[cfg_attr(feature = "python", derive(pyo3::FromPyObject, pyo3::IntoPyObject))]
33-
3433
pub struct MotorPositionSpeedLoad {
3534
pub position: MotorValue<f32>,
3635
// pub speed: MotorValue<f32>,
3736
// pub load: MotorValue<f32>,
3837
}
38+
3939
/// Wrapper for PID gains.
4040
#[derive(Clone, Copy, Debug, PartialEq)]
4141
#[cfg_attr(feature = "python", gen_stub_pyclass, pyo3::pyclass)]

0 commit comments

Comments
 (0)