remove unnecessary mut self references

This commit is contained in:
Toshit Chawda 2024-01-31 08:13:06 -08:00
parent 619a2a61c7
commit fa2b84d646
No known key found for this signature in database
GPG key ID: 91480ED99E2B3D9D
6 changed files with 55 additions and 19 deletions

View file

@ -117,6 +117,7 @@ async fn handle_mux(
loop {
tokio::select! {
event = stream.read() => {
println!("ws rx");
match event {
Some(event) => match event {
WsEvent::Send(data) => {
@ -128,6 +129,7 @@ async fn handle_mux(
}
},
event = tcp_stream_framed.next() => {
println!("tcp rx");
match event.and_then(|x| x.ok()) {
Some(event) => stream.write(event.into()).await?,
None => return Ok(true),
@ -175,8 +177,8 @@ async fn accept_ws(
println!("{:?}: connected", addr);
ServerMux::handle(rx, tx, &mut |packet, stream| async move {
let mut close_err = stream.get_close_handle();
let mut close_ok = stream.get_close_handle();
let close_err = stream.get_close_handle();
let close_ok = stream.get_close_handle();
tokio::spawn(async move {
let _ = handle_mux(packet, stream)
.or_else(|err| async move {