summaryrefslogtreecommitdiff
path: root/server/src/state.rs
diff options
context:
space:
mode:
authormetamuffin <metamuffin@disroot.org>2024-09-16 18:00:28 +0200
committermetamuffin <metamuffin@disroot.org>2024-09-16 18:00:35 +0200
commit499f4994a6a8507dcca20ed820c851be9a2343c1 (patch)
tree9100c6c924e116e811d94d7188353f87819d02d3 /server/src/state.rs
parent709fd5ddaaec290165e85b48b237cb82563b9e87 (diff)
downloadhurrycurry-499f4994a6a8507dcca20ed820c851be9a2343c1.tar
hurrycurry-499f4994a6a8507dcca20ed820c851be9a2343c1.tar.bz2
hurrycurry-499f4994a6a8507dcca20ed820c851be9a2343c1.tar.zst
fix all clippy things
Diffstat (limited to 'server/src/state.rs')
-rw-r--r--server/src/state.rs11
1 files changed, 4 insertions, 7 deletions
diff --git a/server/src/state.rs b/server/src/state.rs
index e368317c..b9a43f6b 100644
--- a/server/src/state.rs
+++ b/server/src/state.rs
@@ -76,15 +76,12 @@ impl Server {
self.packet_in(packet, &mut replies)?;
for p in &replies {
- match p {
- PacketC::Joined { id } => {
- self.connections.entry(conn).or_default().insert(*id);
- }
- _ => (),
+ if let PacketC::Joined { id } = p {
+ self.connections.entry(conn).or_default().insert(*id);
}
}
- if self.count_chefs() <= 0 && !self.game.lobby {
+ if self.count_chefs() == 0 && !self.game.lobby {
self.tx
.send(PacketC::ServerMessage {
text: "Game was aborted due to a lack of players".to_string(),
@@ -97,7 +94,7 @@ impl Server {
pub async fn disconnect(&mut self, conn: ConnectionID) {
if let Some(players) = self.connections.get(&conn) {
- for player in players.to_owned() {
+ for player in players.clone() {
let _ = self.packet_in_outer(conn, PacketS::Leave { player }).await;
}
}