Skip to content

Commit

Permalink
Merge redundant impl Connecting blocks
Browse files Browse the repository at this point in the history
  • Loading branch information
Ralith committed Jun 12, 2023
1 parent 926f927 commit 7914468
Showing 1 changed file with 8 additions and 10 deletions.
18 changes: 8 additions & 10 deletions quinn/src/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -157,6 +157,14 @@ impl Connecting {

inner.inner.local_ip()
}

/// The peer's UDP address.
///
/// Will panic if called after `poll` has returned `Ready`.
pub fn remote_address(&self) -> SocketAddr {
let conn_ref: &ConnectionRef = self.conn.as_ref().expect("used after yielding Ready");
conn_ref.state.lock("remote_address").inner.remote_address()
}
}

impl Future for Connecting {
Expand All @@ -178,16 +186,6 @@ impl Future for Connecting {
}
}

impl Connecting {
/// The peer's UDP address.
///
/// Will panic if called after `poll` has returned `Ready`.
pub fn remote_address(&self) -> SocketAddr {
let conn_ref: &ConnectionRef = self.conn.as_ref().expect("used after yielding Ready");
conn_ref.state.lock("remote_address").inner.remote_address()
}
}

/// Future that completes when a connection is fully established
///
/// For clients, the resulting value indicates if 0-RTT was accepted. For servers, the resulting
Expand Down

0 comments on commit 7914468

Please sign in to comment.