diff options
| author | 魏曹先生 <1992414357@qq.com> | 2025-09-25 15:41:17 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2025-09-25 15:41:17 +0800 |
| commit | 2865206dda1d57df1c95dd8e49d5599db89407ae (patch) | |
| tree | 1e6e2198dacc7cd5f56335b20268856af8bf8a70 /crates/utils/tcp_connection/src | |
| parent | 17233e0c83c1b25a32c641eb32eb1fba3061cdfd (diff) | |
Fix clippy warnings and optimize code
- Rename from_str to from_address_str in tcp_connection to avoid trait conflict
- Use ? operator instead of let...else patterns in local and vault initialization
- Replace manual string slicing with strip_prefix in virtual_file.rs
- All tests continue to pass after optimizations
Diffstat (limited to 'crates/utils/tcp_connection/src')
| -rw-r--r-- | crates/utils/tcp_connection/src/target.rs | 2 |
1 files changed, 1 insertions, 1 deletions
diff --git a/crates/utils/tcp_connection/src/target.rs b/crates/utils/tcp_connection/src/target.rs index a8cb594..88b931a 100644 --- a/crates/utils/tcp_connection/src/target.rs +++ b/crates/utils/tcp_connection/src/target.rs @@ -104,7 +104,7 @@ where } /// Try to create target by string - pub fn from_str<'a>(addr_str: impl Into<&'a str>) -> Result<Self, AddrParseError> { + pub fn from_address_str<'a>(addr_str: impl Into<&'a str>) -> Result<Self, AddrParseError> { let socket_addr = SocketAddr::from_str(addr_str.into()); match socket_addr { Ok(socket_addr) => Ok(Self::from_addr(socket_addr.ip(), socket_addr.port())), |
