From f1de605d19617d87247945f0305c69b2dd5b52d9 Mon Sep 17 00:00:00 2001 From: Waylon Cude Date: Sun, 31 May 2026 14:22:42 -0700 Subject: [PATCH] Cleanup warnings Lots of code paths that dont exist right now. This suppresses the warnings til I come back and finish implementing everything --- src/client.rs | 66 +++++++++++++++++++++++------------------------ src/connection.rs | 2 +- src/main.rs | 6 ++++- 3 files changed, 39 insertions(+), 35 deletions(-) diff --git a/src/client.rs b/src/client.rs index 3f0bf44..b6af58c 100644 --- a/src/client.rs +++ b/src/client.rs @@ -210,7 +210,7 @@ impl Client { // This opens up a quic connection to the remote server, serializes our message, and // processes the response. Should use a long-lived connection but for the prototype its // going to open a new one each time. - async fn forward(&self, server: &fedichat::ServerAddr, message: TaggedMessage) -> Result{ + async fn forward(&self, _server: &fedichat::ServerAddr, _message: TaggedMessage) -> Result{ unimplemented!() } @@ -225,7 +225,7 @@ impl Client { // NOTE: This leaks passwords. Should anonymize it for sure trace!("Handling message: {:?}",&message); - if let Some((ref challenge,ref saved_msg)) = self.in_challenge { + if let Some((ref challenge,ref _saved_msg)) = self.in_challenge { if let ClientMessage::ChallengeAnswer {response} = message.message { // If we successfully complete the challenge then perform the given action if response == *challenge { @@ -354,13 +354,13 @@ impl Client { }, // Replace the body of the message with a new one MessageEdit { - body, - id, - room_id, + body: _, + id: _, + room_id: _, } => {unimplemented!()}, MessageDelete { - id, - room_id, + id: _, + room_id: _, } => {unimplemented!()}, // State Actions // These don't use the DB at all @@ -404,9 +404,9 @@ impl Client { self.run_operation(config,&room_id.into(),user,operation).await }, StateMove { - room_id, - path, - target, + room_id: _, + path: _, + target: _, } => { // This could be a read and a write maybe? unimplemented!() @@ -458,54 +458,54 @@ impl Client { // // Could always do this through a bot that owns a group?? GroupCreate { - group, - users, + group: _, + users: _, } => {unimplemented!()}, // Only the creator of a group or a server admin can delete groups GroupDelete { - group, + group: _, } => {unimplemented!()}, // Only the creator of a group or a server admin can delete groups // same with adding, though there should be a way to add group officers // at some point GroupUserAdd { - group, - users, + group: _, + users: _, } => {unimplemented!()}, GroupUserRemove { - group, - users, + group: _, + users: _, } => {unimplemented!()}, GroupRoleCreate { - group, - role, + group: _, + role: _, } => {unimplemented!()}, GroupRoleDelete { - group, - role, + group: _, + role: _, } => {unimplemented!()}, GroupRoleUserAdd { - group, - role, - users, + group: _, + role: _, + users: _, } => {unimplemented!()}, GroupRoleUserRemove { - group, - role, - users, + group: _, + role: _, + users: _, } => {unimplemented!()}, // Should work like discord roles // Can control who can invite to the group // Can be used with permissions to make rooms that are private for individual roles GroupRolePowerAdd { - group, - role, - power, + group: _, + role: _, + power: _, } => {unimplemented!()}, GroupRolePowerRemove { - group, - role, - power, + group: _, + role: _, + power: _, } => {unimplemented!()}, // Returns an ID to use for message sending // The server can potentially use the current username to associate media uploads diff --git a/src/connection.rs b/src/connection.rs index 76d9998..27e2d17 100644 --- a/src/connection.rs +++ b/src/connection.rs @@ -5,7 +5,7 @@ use std::sync::Arc; use fedichat::message::{Relevance,TaggedMessage}; use diesel_async::pooled_connection::deadpool::Pool; use diesel_async::{AsyncPgConnection}; -use tracing::{instrument,warn,trace,debug}; +use tracing::{instrument,warn,debug}; #[instrument(skip_all)] pub async fn client_handler( diff --git a/src/main.rs b/src/main.rs index cbe9afc..be53d43 100644 --- a/src/main.rs +++ b/src/main.rs @@ -1,3 +1,7 @@ +// suppress warnings from unimplemented paths +// remove once actually done +#![allow(dead_code)] + mod client; mod config; mod connection; @@ -178,7 +182,7 @@ async fn main() -> ExitCode { // Global connections let (close_send,close_recv) = broadcast::channel(1); let (message_send,message_recv) = broadcast::channel(128); - let (message_ack_send,message_ack_recv) = mpsc::channel(128); + let (message_ack_send,_message_ack_recv) = mpsc::channel(128); debug!("Setting ctrl-c handler"); match ctrlc_async::set_async_handler(