Skip to content

Commit 0ec2abb

Browse files
committed
Bump version 0.5.10
1 parent 09b41a3 commit 0ec2abb

File tree

2 files changed

+13
-2
lines changed

2 files changed

+13
-2
lines changed

Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -1,6 +1,6 @@
11
[package]
22
name = "socks5-impl"
3-
version = "0.5.9"
3+
version = "0.5.10"
44
authors = ["ssrlive <[email protected]>"]
55
description = "Fundamental abstractions and async read / write functions for SOCKS5 protocol and Relatively low-level asynchronized SOCKS5 server implementation based on tokio"
66
categories = ["network-programming", "asynchronous"]
@@ -24,7 +24,7 @@ thiserror = "1.0"
2424
tokio = { version = "1.36", features = ["full"], optional = true }
2525

2626
[dev-dependencies]
27-
clap = { version = "4.4", features = ["derive"] }
27+
clap = { version = "4.5", features = ["derive"] }
2828
ctrlc2 = { version = "3.5", features = ["tokio", "termination"] }
2929
dotenvy = "0.15"
3030
env_logger = "0.11"

src/protocol/handshake/password_method/mod.rs

Lines changed: 11 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -17,6 +17,17 @@ pub struct UserKey {
1717
pub password: String,
1818
}
1919

20+
impl std::fmt::Display for UserKey {
21+
fn fmt(&self, f: &mut std::fmt::Formatter<'_>) -> std::fmt::Result {
22+
match (self.username.is_empty(), self.password.is_empty()) {
23+
(true, true) => write!(f, ""),
24+
(true, false) => write!(f, ":{}", self.password),
25+
(false, true) => write!(f, "{}", self.username),
26+
(false, false) => write!(f, "{}:{}", self.username, self.password),
27+
}
28+
}
29+
}
30+
2031
impl UserKey {
2132
/// Constructs `UserKey` with the specified username and a password.
2233
pub fn new<U, P>(username: U, password: P) -> Self

0 commit comments

Comments
 (0)