Skip to content

Commit 15e66f1

Browse files
author
sjfhsjfh
committed
chore: clippy
1 parent 51cdabb commit 15e66f1

2 files changed

Lines changed: 3 additions & 6 deletions

File tree

phira-mp-server/src/server.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -76,8 +76,8 @@ impl From<TcpListener> for Server {
7676
async move {
7777
while let Some(id) = lost_con_rx.recv().await {
7878
warn!("lost connection with {id}");
79-
if let Some(session) = state.sessions.write().await.remove(&id) {
80-
if session
79+
if let Some(session) = state.sessions.write().await.remove(&id)
80+
&& session
8181
.user
8282
.session
8383
.read()
@@ -87,7 +87,6 @@ impl From<TcpListener> for Server {
8787
{
8888
Arc::clone(&session.user).dangle().await;
8989
}
90-
}
9190
}
9291
}
9392
});

phira-mp-server/src/session.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -266,8 +266,7 @@ impl Session {
266266
if let Some(resp) = LANGUAGE
267267
.scope(Arc::new(user.lang.clone()), process(user, cmd))
268268
.await
269-
{
270-
if let Err(err) = send_tx.send(resp).await {
269+
&& let Err(err) = send_tx.send(resp).await {
271270
error!(
272271
"failed to handle message, aborting connection {id}: {err:?}",
273272
);
@@ -276,7 +275,6 @@ impl Session {
276275
error!("failed to mark lost connection ({id}): {err:?}");
277276
}
278277
}
279-
}
280278
}
281279
}
282280
}),

0 commit comments

Comments
 (0)