From fbfb76c34e36dcf6aea1ec770e4d309df09ca904 Mon Sep 17 00:00:00 2001 From: Jonathan Krebs Date: Fri, 13 Dec 2024 08:18:25 +0100 Subject: [PATCH] fix warnings: some more easy cases --- bffhd/authentication/fabfire/server.rs | 1 + bffhd/authentication/mod.rs | 2 +- bffhd/capnp/authenticationsystem.rs | 2 +- bffhd/capnp/permissionsystem.rs | 2 +- bffhd/capnp/user.rs | 2 +- bffhd/lib.rs | 4 ++-- bffhd/users/db.rs | 1 + 7 files changed, 8 insertions(+), 6 deletions(-) diff --git a/bffhd/authentication/fabfire/server.rs b/bffhd/authentication/fabfire/server.rs index f8fc366..315ddcc 100644 --- a/bffhd/authentication/fabfire/server.rs +++ b/bffhd/authentication/fabfire/server.rs @@ -102,6 +102,7 @@ struct AuthInfo { iv: Vec, } +#[allow(non_camel_case_types)] #[derive(Debug, Deserialize, Serialize)] #[serde(tag = "Cmd")] enum CardCommand { diff --git a/bffhd/authentication/mod.rs b/bffhd/authentication/mod.rs index f40fc3a..6c0ea1c 100644 --- a/bffhd/authentication/mod.rs +++ b/bffhd/authentication/mod.rs @@ -26,7 +26,7 @@ impl Callback { impl SessionCallback for Callback { fn callback( &self, - session_data: &SessionData, + _session_data: &SessionData, context: &Context, request: &mut Request, ) -> Result<(), SessionError> { diff --git a/bffhd/capnp/authenticationsystem.rs b/bffhd/capnp/authenticationsystem.rs index 88185e3..9b76319 100644 --- a/bffhd/capnp/authenticationsystem.rs +++ b/bffhd/capnp/authenticationsystem.rs @@ -113,7 +113,7 @@ impl AuthenticationSystem for Authentication { f.write_char(')') } } - let mut response; + let response; let mut builder = results.get(); if let State::Running(mut session, manager) = diff --git a/bffhd/capnp/permissionsystem.rs b/bffhd/capnp/permissionsystem.rs index 4506aa4..de5f0aa 100644 --- a/bffhd/capnp/permissionsystem.rs +++ b/bffhd/capnp/permissionsystem.rs @@ -36,7 +36,7 @@ impl PermissionSystem for Permissions { tracing::trace!("method call"); let roles = self.roles.list().collect::>(); - let mut builder = results.get(); + let builder = results.get(); let mut b = builder.init_role_list(roles.len() as u32); for (i, role) in roles.into_iter().enumerate() { let mut role_builder = b.reborrow().get(i as u32); diff --git a/bffhd/capnp/user.rs b/bffhd/capnp/user.rs index 9990b75..484125f 100644 --- a/bffhd/capnp/user.rs +++ b/bffhd/capnp/user.rs @@ -221,7 +221,7 @@ impl card_d_e_s_fire_e_v2::Server for User { Vec::new() }); if !tk.is_empty() { - let mut b = results.get(); + let b = results.get(); let mut lb = b.init_token_list(1); lb.set(0, &tk[..]); } diff --git a/bffhd/lib.rs b/bffhd/lib.rs index 84b8a31..da1797b 100644 --- a/bffhd/lib.rs +++ b/bffhd/lib.rs @@ -229,13 +229,13 @@ impl Diflouroborane { self.executor.spawn(apiserver.handle_until(rx)); let f = async { - let mut sig = None; + let mut sig; while { sig = signals.next().await; sig.is_none() } {} tracing::info!(signal = %sig.unwrap(), "Received signal"); - tx.send(()); + _ = tx.send(()); // ignore result, as an Err means that the executor we want to stop has already stopped }; self.executor.run(f); diff --git a/bffhd/users/db.rs b/bffhd/users/db.rs index 32da307..df92444 100644 --- a/bffhd/users/db.rs +++ b/bffhd/users/db.rs @@ -182,6 +182,7 @@ impl UserDB { } pub fn clear_txn(&self, txn: &mut RwTransaction) -> Result<(), db::Error> { + // TODO: why is the result ignored here? self.db.clear(txn); Ok(()) }