From d9cee5ddb4a1eda4c75e42a3a4a75f980736f44b Mon Sep 17 00:00:00 2001 From: Andrea Toska Date: Fri, 7 Feb 2025 08:48:22 +0100 Subject: [PATCH] fix(warnings): add an underscore to unused variables --- src/main.rs | 2 +- src/protocols/auth/method_login.rs | 2 +- .../method_auto_matchmake_with_param_postpone.rs | 2 +- src/protocols/matchmake_extension/method_get_playing_session.rs | 2 +- src/protocols/secure/method_register.rs | 2 +- src/protocols/secure/method_send_report.rs | 2 +- src/rmc/structures/buffer.rs | 2 +- src/rmc/structures/connection_data.rs | 2 +- src/rmc/structures/string.rs | 2 +- 9 files changed, 9 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 8a07c5b..d2e3625 100644 --- a/src/main.rs +++ b/src/main.rs @@ -129,7 +129,7 @@ async fn start_auth_server() -> AuthServer{ async move { - let encryption_pairs = Vec::from_iter((0..=count).map(|v| { + let encryption_pairs = Vec::from_iter((0..=count).map(|_v| { let rc4: Rc4 = Rc4::new_from_slice( "CD&ML".as_bytes()).unwrap(); let cypher = Box::new(rc4); let server_cypher: Box = cypher; diff --git a/src/protocols/auth/method_login.rs b/src/protocols/auth/method_login.rs index a647390..d2c1642 100644 --- a/src/protocols/auth/method_login.rs +++ b/src/protocols/auth/method_login.rs @@ -14,7 +14,7 @@ pub async fn login(rmcmessage: &RMCMessage, _name: &str) -> RMCResponseResult{ rmcmessage.error_result_with_code(ErrorCode::Core_NotImplemented) } -pub async fn login_raw_params(rmcmessage: &RMCMessage, _: &Arc, _: &Arc>, data: AuthProtocolConfig) -> RMCResponseResult{ +pub async fn login_raw_params(rmcmessage: &RMCMessage, _: &Arc, _: &Arc>, _data: AuthProtocolConfig) -> RMCResponseResult{ let mut reader = Cursor::new(&rmcmessage.rest_of_data); let Ok(str) = String::deserialize(&mut reader) else { diff --git a/src/protocols/matchmake_extension/method_auto_matchmake_with_param_postpone.rs b/src/protocols/matchmake_extension/method_auto_matchmake_with_param_postpone.rs index 47da00b..2d53080 100644 --- a/src/protocols/matchmake_extension/method_auto_matchmake_with_param_postpone.rs +++ b/src/protocols/matchmake_extension/method_auto_matchmake_with_param_postpone.rs @@ -6,7 +6,7 @@ use crate::protocols::matchmake_common::{ExtendedMatchmakeSession, MatchmakeData use crate::prudp::socket::{ConnectionData, SocketData}; use crate::rmc::message::RMCMessage; use crate::rmc::response::{ErrorCode, RMCResponseResult}; -use crate::rmc::structures::matchmake::{AutoMatchmakeParam, MatchmakeSession}; +use crate::rmc::structures::matchmake::{AutoMatchmakeParam}; use crate::rmc::structures::RmcSerialize; diff --git a/src/protocols/matchmake_extension/method_get_playing_session.rs b/src/protocols/matchmake_extension/method_get_playing_session.rs index ff784d9..bc4eb3c 100644 --- a/src/protocols/matchmake_extension/method_get_playing_session.rs +++ b/src/protocols/matchmake_extension/method_get_playing_session.rs @@ -10,7 +10,7 @@ use crate::rmc::structures::RmcSerialize; type PIDList = Vec; -async fn get_playing_session(rmcmessage: &RMCMessage, data: Arc>) -> RMCResponseResult { +async fn get_playing_session(rmcmessage: &RMCMessage, _data: Arc>) -> RMCResponseResult { //todo: propperly implement this let cheeseburger = PIDList::new(); diff --git a/src/protocols/secure/method_register.rs b/src/protocols/secure/method_register.rs index 16a5777..fcfb438 100644 --- a/src/protocols/secure/method_register.rs +++ b/src/protocols/secure/method_register.rs @@ -13,7 +13,7 @@ use crate::rmc::structures::RmcSerialize; type StringList = Vec; -pub async fn register(rmcmessage: &RMCMessage, station_urls: Vec, conn_data: &Arc>) -> RMCResponseResult{ +pub async fn register(rmcmessage: &RMCMessage, _station_urls: Vec, conn_data: &Arc>) -> RMCResponseResult{ let locked = conn_data.lock().await; let Some(active_connection_data) = locked.active_connection_data.as_ref() else { return rmcmessage.error_result_with_code(ErrorCode::RendezVous_NotAuthenticated) diff --git a/src/protocols/secure/method_send_report.rs b/src/protocols/secure/method_send_report.rs index bdfa8b6..81322f9 100644 --- a/src/protocols/secure/method_send_report.rs +++ b/src/protocols/secure/method_send_report.rs @@ -20,7 +20,7 @@ pub async fn send_report(rmcmessage: &RMCMessage, report_id: u32, data: Vec) return rmcmessage.success_with_data(Vec::new()); } -pub async fn send_report_raw_params(rmcmessage: &RMCMessage, _: &Arc, conn_data: &Arc>, _: ()) -> RMCResponseResult{ +pub async fn send_report_raw_params(rmcmessage: &RMCMessage, _: &Arc, _conn_data: &Arc>, _: ()) -> RMCResponseResult{ let mut reader = Cursor::new(&rmcmessage.rest_of_data); let Ok(error_id) = reader.read_struct(IS_BIG_ENDIAN) else { diff --git a/src/rmc/structures/buffer.rs b/src/rmc/structures/buffer.rs index 8de0349..aea5a45 100644 --- a/src/rmc/structures/buffer.rs +++ b/src/rmc/structures/buffer.rs @@ -11,7 +11,7 @@ impl<'a> RmcSerialize for &'a [u8]{ } /// DO NOT USE (also maybe split off the serialize and deserialize functions at some point) - fn deserialize(reader: &mut dyn Read) -> crate::rmc::structures::Result { + fn deserialize(_reader: &mut dyn Read) -> crate::rmc::structures::Result { panic!("cannot deserialize to a u8 slice reference (use this ONLY for writing)") } } diff --git a/src/rmc/structures/connection_data.rs b/src/rmc/structures/connection_data.rs index d1418b3..de20491 100644 --- a/src/rmc/structures/connection_data.rs +++ b/src/rmc/structures/connection_data.rs @@ -22,7 +22,7 @@ impl<'a> RmcSerialize for ConnectionData<'a>{ }) } - fn deserialize(reader: &mut dyn Read) -> crate::rmc::structures::Result { + fn deserialize(_reader: &mut dyn Read) -> crate::rmc::structures::Result { todo!() } } diff --git a/src/rmc/structures/string.rs b/src/rmc/structures/string.rs index 41f9278..712da2c 100644 --- a/src/rmc/structures/string.rs +++ b/src/rmc/structures/string.rs @@ -23,7 +23,7 @@ impl RmcSerialize for String{ } impl RmcSerialize for &str{ - fn deserialize(reader: &mut dyn Read) -> Result { + fn deserialize(_reader: &mut dyn Read) -> Result { panic!("cannot serialize to &str") } fn serialize(&self, writer: &mut dyn Write) -> Result<()> {