Make clippy happy

This commit is contained in:
Filip Tibell 2024-01-14 10:37:54 +01:00
parent d7c603e881
commit ef9550ced5
No known key found for this signature in database

View file

@ -21,14 +21,7 @@ use super::{
}; };
pub(super) fn bind_to_localhost(port: u16) -> LuaResult<Builder<AddrIncoming>> { pub(super) fn bind_to_localhost(port: u16) -> LuaResult<Builder<AddrIncoming>> {
let addr = match SocketAddr::try_from(([127, 0, 0, 1], port)) { let addr = SocketAddr::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}"
)))
}
};
match Server::try_bind(&addr) { match Server::try_bind(&addr) {
Ok(b) => Ok(b), Ok(b) => Ok(b),
Err(e) => Err(LuaError::external(format!( Err(e) => Err(LuaError::external(format!(