From bb81a32349909d1fcb0ad97be655f1370c29023b Mon Sep 17 00:00:00 2001 From: Jacob Kiers Date: Thu, 5 Oct 2023 13:32:59 +0200 Subject: [PATCH] Deduplicate some code Signed-off-by: Jacob Kiers --- src/servers/mod.rs | 14 +------------- 1 file changed, 1 insertion(+), 13 deletions(-) diff --git a/src/servers/mod.rs b/src/servers/mod.rs index 837b577..3329637 100644 --- a/src/servers/mod.rs +++ b/src/servers/mod.rs @@ -84,19 +84,7 @@ impl Server { ); let handle = tokio::spawn(async move { match config.protocol.as_ref() { - "tcp" => { - let res = tcp::proxy(config.clone()).await; - if res.is_err() { - error!("Failed to start {}: {}", config.name, res.err().unwrap()); - } - } - "tcp4" => { - let res = tcp::proxy(config.clone()).await; - if res.is_err() { - error!("Failed to start {}: {}", config.name, res.err().unwrap()); - } - } - "tcp6" => { + "tcp" | "tcp4" | "tcp6" => { let res = tcp::proxy(config.clone()).await; if res.is_err() { error!("Failed to start {}: {}", config.name, res.err().unwrap());