Skip to content

Commit

Permalink
Clippy
Browse files Browse the repository at this point in the history
  • Loading branch information
sandreae committed Jun 22, 2024
1 parent dc6afd8 commit 677c2ab
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions aquadoggo/src/network/peers/peer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ impl Human for Peer {
// Trick to nicely display `ConnectionId` struct
let connection_id = format!("{:?}", self.1);
let connection_id = connection_id[13..]
.strip_suffix(")")
.strip_suffix(')')
.expect("ConnectionId format is as expected");
format!("{} ({})", self.0, connection_id)
}
Expand All @@ -82,7 +82,10 @@ mod tests {
assert_eq!(peer_connection_2.display(), format!("{} ({})", peer_id, 2));

let peer_connection_23 = Peer::new(peer_id, ConnectionId::new_unchecked(23));
assert_eq!(peer_connection_23.display(), format!("{} ({})", peer_id, 23));
assert_eq!(
peer_connection_23.display(),
format!("{} ({})", peer_id, 23)
);

let peer_connection_999 = Peer::new(peer_id, ConnectionId::new_unchecked(999));
assert_eq!(
Expand Down

0 comments on commit 677c2ab

Please sign in to comment.