Skip to content

Commit

Permalink
chore(core): use matches! in connection.rs
Browse files Browse the repository at this point in the history
  • Loading branch information
xep-c-6yrpa committed Dec 13, 2024
1 parent d7b66a7 commit 5d51a64
Showing 1 changed file with 2 additions and 8 deletions.
10 changes: 2 additions & 8 deletions core/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -121,18 +121,12 @@ impl ConnectedPoint {

/// Returns true if we are `Dialer`.
pub fn is_dialer(&self) -> bool {
match self {
ConnectedPoint::Dialer { .. } => true,
ConnectedPoint::Listener { .. } => false,
}
matches!(self, ConnectedPoint::Dialer { .. })
}

/// Returns true if we are `Listener`.
pub fn is_listener(&self) -> bool {
match self {
ConnectedPoint::Dialer { .. } => false,
ConnectedPoint::Listener { .. } => true,
}
matches!(self, ConnectedPoint::Listener { .. })
}

/// Returns true if the connection is relayed.
Expand Down

0 comments on commit 5d51a64

Please sign in to comment.