diff options
Diffstat (limited to 'crates/utils/tcp_connection')
| -rw-r--r-- | crates/utils/tcp_connection/src/target.rs | 2 | ||||
| -rw-r--r-- | crates/utils/tcp_connection/tcp_connection_test/src/test_tcp_target_build.rs | 3 |
2 files changed, 3 insertions, 2 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())), diff --git a/crates/utils/tcp_connection/tcp_connection_test/src/test_tcp_target_build.rs b/crates/utils/tcp_connection/tcp_connection_test/src/test_tcp_target_build.rs index 0e1ed67..bcaada3 100644 --- a/crates/utils/tcp_connection/tcp_connection_test/src/test_tcp_target_build.rs +++ b/crates/utils/tcp_connection/tcp_connection_test/src/test_tcp_target_build.rs @@ -7,7 +7,8 @@ fn test_tcp_test_target_build() { let host = "127.0.0.1:8080"; // Test build target by string - let Ok(target) = TcpServerTarget::<ExampleClientHandle, ExampleServerHandle>::from_str(host) + let Ok(target) = + TcpServerTarget::<ExampleClientHandle, ExampleServerHandle>::from_address_str(host) else { panic!("Test target built failed from a target addr `{}`", host); }; |
