Skip to content

Commit

Permalink
Switch to a matches macro
Browse files Browse the repository at this point in the history
  • Loading branch information
nyonson committed Sep 25, 2024
1 parent 62d5849 commit 29c2af6
Showing 1 changed file with 4 additions and 1 deletion.
5 changes: 4 additions & 1 deletion protocol/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -858,7 +858,10 @@ impl<'a> Handshake<'a> {
self.current_packet_length_bytes = None;

// The version packet is currently just an empty packet.
Ok(PacketType::from_bytes(packet_buffer) == PacketType::Genuine)
Ok(matches!(
PacketType::from_bytes(packet_buffer),
PacketType::Genuine
))
}

/// Complete the handshake and return the packet handler for further communication.
Expand Down

0 comments on commit 29c2af6

Please sign in to comment.