Skip to content

Commit

Permalink
Minor cleanup
Browse files Browse the repository at this point in the history
  • Loading branch information
fpagliughi committed Apr 4, 2023
1 parent 7f7d197 commit a2fb5a7
Showing 1 changed file with 3 additions and 7 deletions.
10 changes: 3 additions & 7 deletions src/frame.rs
Original file line number Diff line number Diff line change
Expand Up @@ -503,8 +503,7 @@ impl fmt::UpperHex for CanDataFrame {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
write!(f, "{:X}#", self.0.can_id)?;
let mut parts = self.data().iter().map(|v| format!("{:02X}", v));
let sep = " ";
write!(f, "{}", parts.join(sep))
write!(f, "{}", parts.join(" "))
}
}

Expand Down Expand Up @@ -790,8 +789,7 @@ impl fmt::UpperHex for CanErrorFrame {
fn fmt(&self, f: &mut fmt::Formatter) -> Result<(), fmt::Error> {
write!(f, "{:X}#", self.0.can_id)?;
let mut parts = self.data().iter().map(|v| format!("{:02X}", v));
let sep = " ";
write!(f, "{}", parts.join(sep))
write!(f, "{}", parts.join(" "))
}
}

Expand Down Expand Up @@ -975,9 +973,7 @@ impl fmt::UpperHex for CanFdFrame {
write!(f, "{:X}##", self.0.can_id)?;
write!(f, "{} ", self.0.flags)?;
let mut parts = self.data().iter().map(|v| format!("{:02X}", v));
//let sep = if f.alternate() { " " } else { " " };
let sep = " ";
write!(f, "{}", parts.join(sep))
write!(f, "{}", parts.join(" "))
}
}

Expand Down

0 comments on commit a2fb5a7

Please sign in to comment.