mirror of
https://github.com/trussed-dev/iso7816.git
synced 2026-06-20 04:16:14 -07:00
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:
+5
-5
@@ -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("'")?;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user