From ef9550ced599e10cff0a620b2e67bf854866eb02 Mon Sep 17 00:00:00 2001 From: Filip Tibell Date: Sun, 14 Jan 2024 10:37:54 +0100 Subject: [PATCH] Make clippy happy --- src/lune/builtins/net/server.rs | 9 +-------- 1 file changed, 1 insertion(+), 8 deletions(-) diff --git a/src/lune/builtins/net/server.rs b/src/lune/builtins/net/server.rs index e00c2d5..97f22c7 100644 --- a/src/lune/builtins/net/server.rs +++ b/src/lune/builtins/net/server.rs @@ -21,14 +21,7 @@ use super::{ }; pub(super) fn bind_to_localhost(port: u16) -> LuaResult> { - let addr = match SocketAddr::try_from(([127, 0, 0, 1], port)) { - Ok(a) => a, - Err(e) => { - return Err(LuaError::external(format!( - "Failed to bind to localhost on port {port}\n{e}" - ))) - } - }; + let addr = SocketAddr::from(([127, 0, 0, 1], port)); match Server::try_bind(&addr) { Ok(b) => Ok(b), Err(e) => Err(LuaError::external(format!(