Simplify Debug implementation for Aid

This patch replaces f.write_fmt(format_args!(...)) with write!(f, ...)
and uses named parameters where possible to fix a clippy lint.
This commit is contained in:
Robin Krahl
2026-04-17 11:44:15 +02:00
parent 147e20e3e5
commit 32da051356
+5 -5
View File
@@ -57,25 +57,25 @@ impl core::fmt::Debug for Aid {
if self.truncated_len >= self.len {
f.write_str("'")?;
for b in &self.bytes[..5] {
f.write_fmt(format_args!("{:02X}", b))?;
write!(f, "{b:02X}")?;
}
f.write_str(" ")?;
for b in &self.bytes[5..self.len as _] {
f.write_fmt(format_args!("{:02X}", b))?;
write!(f, "{b:02X}")?;
}
f.write_str("'")?;
} else {
f.write_str("'")?;
for b in &self.bytes[..5] {
f.write_fmt(format_args!("{:02X}", b))?;
write!(f, "{b:02X}")?;
}
f.write_str(" ")?;
for b in &self.bytes[5..self.truncated_len as _] {
f.write_fmt(format_args!("{:02X}", b))?;
write!(f, "{b:02X}")?;
}
f.write_str(" ")?;
for b in &self.bytes[self.truncated_len as _..self.len as _] {
f.write_fmt(format_args!("{:02X}", b))?;
write!(f, "{b:02X}")?;
}
f.write_str("'")?;
}