summaryrefslogtreecommitdiff
path: root/crates/utils/tcp_connection/src/target_connection.rs
diff options
context:
space:
mode:
Diffstat (limited to 'crates/utils/tcp_connection/src/target_connection.rs')
-rw-r--r--crates/utils/tcp_connection/src/target_connection.rs6
1 files changed, 3 insertions, 3 deletions
diff --git a/crates/utils/tcp_connection/src/target_connection.rs b/crates/utils/tcp_connection/src/target_connection.rs
index b03093c..87fd1ab 100644
--- a/crates/utils/tcp_connection/src/target_connection.rs
+++ b/crates/utils/tcp_connection/src/target_connection.rs
@@ -24,7 +24,7 @@ where
let Ok(socket) = TcpSocket::new_v4() else {
return Err(TcpTargetError::from("Create tcp socket failed!"));
};
- let stream = match socket.connect(addr.clone()).await {
+ let stream = match socket.connect(addr).await {
Ok(stream) => stream,
Err(e) => {
let err = format!("Connect to `{}` failed: {}", addr, e);
@@ -40,7 +40,7 @@ where
/// This function initiates a connection to the server address specified in the target configuration.
pub async fn listen(&self) -> Result<(), TcpTargetError> {
let addr = self.get_addr();
- let listener = match TcpListener::bind(addr.clone()).await {
+ let listener = match TcpListener::bind(addr).await {
Ok(listener) => listener,
Err(_) => {
let err = format!("Bind to `{}` failed", addr);
@@ -49,7 +49,7 @@ where
};
let cfg: ServerTargetConfig = match self.get_server_cfg() {
- Some(cfg) => cfg.clone(),
+ Some(cfg) => *cfg,
None => ServerTargetConfig::default(),
};