Skip to content

Commit

Permalink
Remove unneeded dereferences in match statements
Browse files Browse the repository at this point in the history
  • Loading branch information
zargony committed Sep 24, 2024
1 parent 4dad7a3 commit 8e15194
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 9 deletions.
16 changes: 8 additions & 8 deletions firmware/src/nfc.rs
Original file line number Diff line number Diff line change
Expand Up @@ -214,20 +214,20 @@ fn write_hex_bytes(f: &mut fmt::Formatter<'_>, bytes: &[u8]) -> fmt::Result {

impl fmt::Display for Uid {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
match *self {
Self::Single(ref bytes) => write_hex_bytes(f, bytes),
Self::Double(ref bytes) => write_hex_bytes(f, bytes),
Self::Triple(ref bytes) => write_hex_bytes(f, bytes),
match self {
Self::Single(bytes) => write_hex_bytes(f, bytes),
Self::Double(bytes) => write_hex_bytes(f, bytes),
Self::Triple(bytes) => write_hex_bytes(f, bytes),
}
}
}

impl AsRef<[u8]> for Uid {
fn as_ref(&self) -> &[u8] {
match *self {
Self::Single(ref bytes) => bytes,
Self::Double(ref bytes) => bytes,
Self::Triple(ref bytes) => bytes,
match self {
Self::Single(bytes) => bytes,
Self::Double(bytes) => bytes,
Self::Triple(bytes) => bytes,
}
}
}
2 changes: 1 addition & 1 deletion firmware/src/screen.rs
Original file line number Diff line number Diff line change
Expand Up @@ -112,7 +112,7 @@ impl Screen for PleaseWait {
target,
)?;
SMALL_FONT.render_aligned(
match *self {
match self {
Self::WifiConnecting => "WLAN Verbindung\nwird aufgebaut",
},
Point::new(63, 27 + 12),
Expand Down

0 comments on commit 8e15194

Please sign in to comment.