remove extra return

This commit is contained in:
yggverse 2025-09-08 14:46:22 +03:00
parent fea85909cd
commit 91186b8641

View file

@ -113,7 +113,7 @@ fn handle(
// header bytes received but yet could not be parsed, // header bytes received but yet could not be parsed,
// complete with request failure // complete with request failure
return send( send(
&response::failure::permanent::BadRequest { &response::failure::permanent::BadRequest {
message: Some("Bad request".to_string()), message: Some("Bad request".to_string()),
} }
@ -123,22 +123,20 @@ fn handle(
Ok(()) => warn!("Bad request from peer `{peer}`"), Ok(()) => warn!("Bad request from peer `{peer}`"),
Err(e) => error!("Send packet to peer `{peer}` failed: {e}"), Err(e) => error!("Send packet to peer `{peer}` failed: {e}"),
}, },
); )
} }
} }
Err(e) => { Err(e) => send(
return send( &response::failure::permanent::BadRequest {
&response::failure::permanent::BadRequest { message: Some("Bad request".to_string()),
message: Some("Bad request".to_string()), }
} .into_bytes(),
.into_bytes(), &mut stream,
&mut stream, |result| match result {
|result| match result { Ok(()) => warn!("Send failure response to peer `{peer}`: {e}"),
Ok(()) => warn!("Send failure response to peer `{peer}`: {e}"), Err(e) => error!("Send packet to peer `{peer}` failed: {e}"),
Err(e) => error!("Send packet to peer `{peer}` failed: {e}"), },
}, ),
);
}
} }
} }
} }
@ -189,7 +187,8 @@ fn response(
}, },
); );
} }
// try info page @TODO // try info page
todo!()
} }
fn close(stream: &mut TlsStream<TcpStream>) -> Result<()> { fn close(stream: &mut TlsStream<TcpStream>) -> Result<()> {