From 8b579c088f3f10034206e46bb0a78e73c4923c40 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Fri, 17 May 2024 18:32:22 +0300 Subject: [PATCH] build: warnings, unused dependency --- Cargo.lock | 1 - Cargo.toml | 1 - src/gui/platform/desktop/mod.rs | 2 +- src/wallet/connections/config.rs | 4 ++-- src/wallet/wallet.rs | 9 ++------- 5 files changed, 5 insertions(+), 12 deletions(-) diff --git a/Cargo.lock b/Cargo.lock index 174e217..d1e87d3 100644 --- a/Cargo.lock +++ b/Cargo.lock @@ -3757,7 +3757,6 @@ version = "0.1.0" dependencies = [ "android-activity 0.6.0", "android_logger", - "anyhow", "arboard", "arti", "arti-client", diff --git a/Cargo.toml b/Cargo.toml index dd07c67..f0e0410 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -38,7 +38,6 @@ egui_extras = { version = "0.27.2", features = ["image", "svg"] } rust-i18n = "2.3.1" ## other -anyhow = "1.0.75" thiserror = "1.0.58" futures = "0.3" dirs = "5.0.1" diff --git a/src/gui/platform/desktop/mod.rs b/src/gui/platform/desktop/mod.rs index 39456f4..becab93 100644 --- a/src/gui/platform/desktop/mod.rs +++ b/src/gui/platform/desktop/mod.rs @@ -153,7 +153,7 @@ impl PlatformCallbacks for Desktop { } } -/// Last captured image from started camera. lazy_static! { + /// Last captured image from started camera. static ref LAST_CAMERA_IMAGE: Arc, u32)>>> = Arc::new(RwLock::new(None)); } diff --git a/src/wallet/connections/config.rs b/src/wallet/connections/config.rs index 5ba9961..9562aec 100644 --- a/src/wallet/connections/config.rs +++ b/src/wallet/connections/config.rs @@ -74,7 +74,7 @@ impl ConnectionsConfig { } let mut w_config = Settings::conn_config_to_update(); let mut exists = false; - for mut c in w_config.external.iter_mut() { + for c in w_config.external.iter_mut() { // Update connection if config exists. if c.id == conn.id { c.url = conn.url.clone(); @@ -104,7 +104,7 @@ impl ConnectionsConfig { /// Set [`ExternalConnection`] availability flag. pub fn update_ext_conn_availability(id: i64, available: bool) { let mut w_config = Settings::conn_config_to_update(); - for mut c in w_config.external.iter_mut() { + for c in w_config.external.iter_mut() { if c.id == id { c.available = Some(available); w_config.save(); diff --git a/src/wallet/wallet.rs b/src/wallet/wallet.rs index 772deac..e5f1205 100644 --- a/src/wallet/wallet.rs +++ b/src/wallet/wallet.rs @@ -24,7 +24,6 @@ use std::thread::Thread; use std::time::Duration; use futures::channel::oneshot; use serde_json::{json, Value}; -use tor_rtcompat::tokio::TokioNativeTlsRuntime; use rand::Rng; use grin_api::{ApiServer, Router}; @@ -739,10 +738,6 @@ impl Wallet { // Parse response and finalize transaction. let res: Value = serde_json::from_str(&req_res.unwrap()).unwrap(); if res["error"] != json!(null) { - let report = format!( - "Posting transaction slate: Error: {}, Message: {}", - res["error"]["code"], res["error"]["message"] - ); cancel_tx(); return None; } @@ -1271,7 +1266,7 @@ fn sync_wallet_data(wallet: &Wallet) { // Setup reposting height. let mut repost_height = None; if posting { - if let Some(mut data) = wallet.get_data() { + if let Some(data) = wallet.get_data() { for t in data.txs { if t.data.id == tx.id { repost_height = t.repost_height; @@ -1374,7 +1369,7 @@ fn update_accounts(wallet: &Wallet, current_height: u64, current_spendable: Opti // Update only current account if list is not empty. if current_spendable.is_some() { let mut accounts = wallet.accounts.read().clone(); - for mut a in accounts.iter_mut() { + for a in accounts.iter_mut() { if a.label == wallet.get_config().account { a.spendable_amount = current_spendable.unwrap(); }