diff options
| author | mat <git@matdoes.dev> | 2025-05-07 06:48:59 -1100 |
|---|---|---|
| committer | mat <git@matdoes.dev> | 2025-05-07 06:48:59 -1100 |
| commit | a8e76a0bff182bbcb7b40e9283f78efbac7e630c (patch) | |
| tree | 64a8296bb0400e2aaf92d1ebfec2158115341236 /azalea-protocol/src | |
| parent | 2b7be768f29bd77661be31fe6e107c1be84853e7 (diff) | |
| download | azalea-drasl-a8e76a0bff182bbcb7b40e9283f78efbac7e630c.tar.xz | |
impl Display for proxy and trace log JoinOpts
Diffstat (limited to 'azalea-protocol/src')
| -rw-r--r-- | azalea-protocol/src/connect.rs | 11 |
1 files changed, 10 insertions, 1 deletions
diff --git a/azalea-protocol/src/connect.rs b/azalea-protocol/src/connect.rs index 3d375dfc..8d2711a7 100644 --- a/azalea-protocol/src/connect.rs +++ b/azalea-protocol/src/connect.rs @@ -1,6 +1,6 @@ //! Connect to remote servers/clients. -use std::fmt::Debug; +use std::fmt::{self, Debug, Display}; use std::io::{self, Cursor}; use std::marker::PhantomData; use std::net::SocketAddr; @@ -274,6 +274,15 @@ impl Proxy { Self { addr, auth } } } +impl Display for Proxy { + fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result { + write!(f, "socks5://")?; + if let Some(auth) = &self.auth { + write!(f, "{}@", auth)?; + } + write!(f, "{}", self.addr) + } +} impl Connection<ClientboundHandshakePacket, ServerboundHandshakePacket> { /// Create a new connection to the given address. |
