From ba91ca42911e56734860e5d710f4897845043c0d Mon Sep 17 00:00:00 2001 From: Joshua Goins Date: Mon, 14 Apr 2025 16:24:46 -0400 Subject: [PATCH] Fix various Clippy warnings --- src/bin/kawari-login.rs | 2 +- src/bin/kawari-world.rs | 15 ++++++--------- src/common/mod.rs | 2 +- src/world/connection.rs | 1 - 4 files changed, 8 insertions(+), 12 deletions(-) diff --git a/src/bin/kawari-login.rs b/src/bin/kawari-login.rs index bd49930..8694054 100644 --- a/src/bin/kawari-login.rs +++ b/src/bin/kawari-login.rs @@ -189,7 +189,7 @@ async fn account(State(state): State, jar: CookieJar) -> Html< } } -async fn logout(State(state): State, jar: CookieJar) -> (CookieJar, Redirect) { +async fn logout(jar: CookieJar) -> (CookieJar, Redirect) { let config = get_config(); // TODO: remove session from database ( diff --git a/src/bin/kawari-world.rs b/src/bin/kawari-world.rs index 650fb4c..7612749 100644 --- a/src/bin/kawari-world.rs +++ b/src/bin/kawari-world.rs @@ -25,7 +25,7 @@ use kawari::world::{ ChatHandler, Zone, ZoneConnection, ipc::{ ActorControlCategory, ActorControlSelf, CommonSpawn, PlayerEntry, PlayerSetup, PlayerSpawn, - PlayerStats, SocialList, + SocialList, }, }; @@ -238,11 +238,8 @@ async fn client_server_loop( mut data: Receiver, internal_send: UnboundedSender, ) { - loop { - match data.recv().await { - Some(msg) => internal_send.send(msg).unwrap(), - None => break, - } + while let Some(msg) = data.recv().await { + internal_send.send(msg).unwrap() } } @@ -446,17 +443,17 @@ async fn client_loop( connection.handle.send(ToServer::ActorSpawned(connection.id, Actor { id: ObjectId(connection.player_data.actor_id), hp: 100, spawn_index: 0 }, connection.get_player_common_spawn(None, None))).await; } ClientZoneIpcData::Unk1 { - category, param1, .. + category, .. } => { tracing::info!("Recieved Unk1! {category:#?}"); - match category { + /*match category { 3 => { // set target tracing::info!("Targeting actor {param1}"); } _ => {} - } + }*/ } ClientZoneIpcData::Unk2 { .. } => { tracing::info!("Recieved Unk2!"); diff --git a/src/common/mod.rs b/src/common/mod.rs index 5eb1187..4df859b 100644 --- a/src/common/mod.rs +++ b/src/common/mod.rs @@ -99,7 +99,7 @@ pub(crate) fn write_packed_rotation_float(float: &f32) -> u8 { (0x80 as f32 * (float + pi) / pi) as u8 } -pub(crate) fn read_packed_rotation_float(packed: u8) -> f32 { +pub(crate) fn read_packed_rotation_float(_packed: u8) -> f32 { 0.0 } diff --git a/src/world/connection.rs b/src/world/connection.rs index fc4ad63..b94f454 100644 --- a/src/world/connection.rs +++ b/src/world/connection.rs @@ -300,7 +300,6 @@ impl ZoneConnection { speed: 0x3C, unk1: 0xEA, position, - ..Default::default() }), ..Default::default() };