From 7914468e27621633a8399c8d02fbf3f557d54df2 Mon Sep 17 00:00:00 2001 From: Benjamin Saunders Date: Sun, 11 Jun 2023 16:38:36 -0700 Subject: [PATCH] Merge redundant `impl Connecting` blocks --- quinn/src/connection.rs | 18 ++++++++---------- 1 file changed, 8 insertions(+), 10 deletions(-) diff --git a/quinn/src/connection.rs b/quinn/src/connection.rs index 7d5706e24..d21313f9e 100644 --- a/quinn/src/connection.rs +++ b/quinn/src/connection.rs @@ -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 { @@ -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