Skip to content

Commit

Permalink
clippy: changed match to if
Browse files Browse the repository at this point in the history
  • Loading branch information
AnonymousBit0111 committed Oct 26, 2024
1 parent c94266f commit 0067cc9
Showing 1 changed file with 6 additions and 9 deletions.
15 changes: 6 additions & 9 deletions src/bin/src/packet_handlers/tick_handler.rs
Original file line number Diff line number Diff line change
Expand Up @@ -25,16 +25,13 @@ async fn handle_tick(event: TickEvent, state: GlobalState) -> Result<TickEvent,
.query::<(&mut StreamWriter, &ConnectionState)>();

for (mut writer, connection_state) in query {
match *connection_state {
ConnectionState::Play => {
if let Err(e) = writer
.send_packet(packet.as_ref(), &NetEncodeOpts::WithLength)
.await
{
error!("Error sending update_time packet: {}", e);
}
if let ConnectionState::Play = *connection_state {
if let Err(e) = writer
.send_packet(packet.as_ref(), &NetEncodeOpts::WithLength)
.await
{
error!("Error sending update_time packet: {}", e);
}
_ => {}
}
}

Expand Down

0 comments on commit 0067cc9

Please sign in to comment.