aboutsummaryrefslogtreecommitdiff
path: root/azalea-protocol
diff options
context:
space:
mode:
authormat <git@matdoes.dev>2025-05-07 06:48:59 -1100
committermat <git@matdoes.dev>2025-05-07 06:48:59 -1100
commita8e76a0bff182bbcb7b40e9283f78efbac7e630c (patch)
tree64a8296bb0400e2aaf92d1ebfec2158115341236 /azalea-protocol
parent2b7be768f29bd77661be31fe6e107c1be84853e7 (diff)
downloadazalea-drasl-a8e76a0bff182bbcb7b40e9283f78efbac7e630c.tar.xz
impl Display for proxy and trace log JoinOpts
Diffstat (limited to 'azalea-protocol')
-rw-r--r--azalea-protocol/src/connect.rs11
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.