From 39b6351c85df96cd795e78cf4fa62089e9f0174f Mon Sep 17 00:00:00 2001 From: Jonathan Wanke Date: Fri, 10 Apr 2026 00:36:46 +0200 Subject: [PATCH] Added allows for unused things. --- iota-cli/src/screens/terms_checker.rs | 1 + iota-cli/src/ui.rs | 5 +---- iota-core/src/main.rs | 6 ++++-- iota-updater/src/lib.rs | 2 -- omikron-connector/src/omikron_connection.rs | 5 ++++- omikron-connector/src/ping_pong_task.rs | 1 - web-ui/src/api.rs | 2 +- 7 files changed, 11 insertions(+), 11 deletions(-) diff --git a/iota-cli/src/screens/terms_checker.rs b/iota-cli/src/screens/terms_checker.rs index 0d64187..c570769 100644 --- a/iota-cli/src/screens/terms_checker.rs +++ b/iota-cli/src/screens/terms_checker.rs @@ -26,6 +26,7 @@ pub enum UserChoice { AcceptAll, } +#[allow(dead_code)] // ui is unused pub struct TermsCheckerScreen { ui: Arc, sender: Option>, diff --git a/iota-cli/src/ui.rs b/iota-cli/src/ui.rs index 723babe..a44ee74 100644 --- a/iota-cli/src/ui.rs +++ b/iota-cli/src/ui.rs @@ -9,10 +9,7 @@ use ratatui::{Terminal, backend::CrosstermBackend, init}; use std::{ collections::VecDeque, io::Stdout, - sync::{ - Arc, Mutex, - atomic::{AtomicBool, Ordering}, - }, + sync::{Arc, Mutex, atomic::Ordering}, time::Duration, }; use tokio::{sync::RwLock, time::Instant}; diff --git a/iota-core/src/main.rs b/iota-core/src/main.rs index af76140..6ae276a 100644 --- a/iota-core/src/main.rs +++ b/iota-core/src/main.rs @@ -15,7 +15,7 @@ use iota_util::file_util::{download_and_extract_zip, has_dir}; use omikron_connector as omikron; #[tokio::main(flavor = "multi_thread", worker_threads = 16)] -#[allow(unused_must_use, dead_code)] +#[allow(unused_must_use, dead_code, unused_assignments)] async fn main() { while *RELOAD.read().await { *RELOAD.write().await = false; @@ -107,7 +107,9 @@ async fn main() { sb1 = sb1 + ","; } log!("Community IDS: {}", sb1); */ + #[allow(unused_variables)] // port is unused let port = CONFIG.read().await.get_port(); + #[allow(unused_variables)] // ip is unused let mut ip = "0.0.0.0".to_string(); for iface in pnet::datalink::interfaces() { let iface: NetworkInterface = iface; @@ -115,7 +117,7 @@ async fn main() { let ipsv = format!("{}", iface.ips[0]); let ips: &str = ipsv.split('/').next().unwrap_or(""); if format!("{}", ips).starts_with("10.") || format!("{}", ips).starts_with("192.") { - ip = ips.to_string(); + ip = ips.to_string(); // Unused assignments. } } } diff --git a/iota-updater/src/lib.rs b/iota-updater/src/lib.rs index 4d8ddbb..af2982e 100644 --- a/iota-updater/src/lib.rs +++ b/iota-updater/src/lib.rs @@ -7,7 +7,6 @@ use anyhow::{Context, Result, anyhow}; use iota_logger::log; use self_replace::self_replace; use semver::Version; -use std::fs::File; use tempfile::NamedTempFile; const CURRENT_VERSION: &str = env!("CARGO_PKG_VERSION"); @@ -108,7 +107,6 @@ async fn download_asset(url: &str) -> Result { } let tmp = NamedTempFile::new().context("failed to create temp file")?; - let mut out = File::create(tmp.path()).context("failed to open temp file")?; let bytes = response .bytes() diff --git a/omikron-connector/src/omikron_connection.rs b/omikron-connector/src/omikron_connection.rs index d6b0ff4..9aa7f15 100755 --- a/omikron-connector/src/omikron_connection.rs +++ b/omikron-connector/src/omikron_connection.rs @@ -79,6 +79,7 @@ impl ConnectionState { // Omikron Connection (Client-side with auto-reconnect) // ============================================================================ +#[allow(dead_code)] // message_send_times is unused. pub struct OmikronConnection { state: Arc>, sender: Arc>>>, @@ -283,6 +284,7 @@ impl OmikronConnection { if iota_id == 0 { log_t!("iota_register_new"); + #[allow(unused_variables)] // priv_k is unused let (pub_k, priv_k) = if let (Some(pk), Some(sk)) = (public_key, private_key) { (pk, sk) } else { @@ -426,9 +428,10 @@ impl OmikronConnection { if cv.is_type(CommunicationType::client_connected) { let user_id = cv.get_data(DataTypes::user_id).as_number().unwrap_or(0) as i64; + #[allow(unused_variables)] // session_id is unused. let session_id = cv.get_data(DataTypes::session_id).as_number().unwrap_or(0) as i64; - let mut contacts = chats_util::get_users(user_id); + let contacts = chats_util::get_users(user_id); let mut contacts_array = Vec::new(); for (i, contact) in contacts.iter().enumerate() { diff --git a/omikron-connector/src/ping_pong_task.rs b/omikron-connector/src/ping_pong_task.rs index fc21855..18e651f 100644 --- a/omikron-connector/src/ping_pong_task.rs +++ b/omikron-connector/src/ping_pong_task.rs @@ -1,6 +1,5 @@ use crate::omikron_connection::OmikronConnection; use dashmap::DashMap; -use iota_logger::log; use iota_state::APP_STATE; use std::sync::LazyLock; use std::time::Instant; diff --git a/web-ui/src/api.rs b/web-ui/src/api.rs index 7092aba..3c43bf6 100755 --- a/web-ui/src/api.rs +++ b/web-ui/src/api.rs @@ -70,7 +70,7 @@ async fn communities_get(req: HttpRequest, ssl: web::Data) -> impl Respond async fn communities_add( req: HttpRequest, ssl: web::Data, - payload: web::Json, + #[allow(unused_variables)] payload: web::Json, ) -> impl Responder { if !is_allowed_req(&req, *ssl.get_ref()) { return forbidden();