From 2aa22030ebe8d4b5617684c1e9cc58389a426f18 Mon Sep 17 00:00:00 2001 From: ardocrat Date: Wed, 15 May 2024 20:51:14 +0300 Subject: [PATCH] build: common warnings --- src/gui/views/network/content.rs | 3 +-- src/gui/views/network/node.rs | 3 +-- src/gui/views/title_panel.rs | 2 +- src/gui/views/views.rs | 4 +--- src/gui/views/wallets/content.rs | 6 +++--- src/gui/views/wallets/creation/creation.rs | 5 ++--- src/gui/views/wallets/setup/common.rs | 6 +++--- src/gui/views/wallets/setup/connection.rs | 4 ++-- src/gui/views/wallets/setup/recovery.rs | 2 +- src/gui/views/wallets/wallet/content.rs | 2 +- src/tor/tor.rs | 5 ----- 11 files changed, 16 insertions(+), 26 deletions(-) diff --git a/src/gui/views/network/content.rs b/src/gui/views/network/content.rs index 53a9365..2e4c095 100644 --- a/src/gui/views/network/content.rs +++ b/src/gui/views/network/content.rs @@ -13,7 +13,6 @@ // limitations under the License. use egui::{Margin, RichText, ScrollArea, Stroke}; -use grin_servers::common::types::Error; use crate::AppConfig; use crate::gui::Colors; @@ -193,7 +192,7 @@ impl NetworkContent { ui: &mut egui::Ui, frame: &mut eframe::Frame, show_connections: bool, - cb: &dyn PlatformCallbacks) { + _: &dyn PlatformCallbacks) { // Setup values for title panel. let title_text = self.node_tab_content.get_type().title().to_uppercase(); let subtitle_text = Node::get_sync_status_text(); diff --git a/src/gui/views/network/node.rs b/src/gui/views/network/node.rs index 18c53ca..3809d71 100644 --- a/src/gui/views/network/node.rs +++ b/src/gui/views/network/node.rs @@ -13,11 +13,10 @@ // limitations under the License. use egui::{RichText, Rounding, ScrollArea}; -use grin_servers::common::types::Error; use grin_servers::PeerStats; use crate::gui::Colors; -use crate::gui::icons::{ARROWS_COUNTER_CLOCKWISE, AT, CUBE, DEVICES, FLOW_ARROW, HANDSHAKE, PACKAGE, PLUGS_CONNECTED, SHARE_NETWORK}; +use crate::gui::icons::{AT, CUBE, DEVICES, FLOW_ARROW, HANDSHAKE, PACKAGE, PLUGS_CONNECTED, SHARE_NETWORK}; use crate::gui::platform::PlatformCallbacks; use crate::gui::views::{NetworkContent, Root, View}; use crate::gui::views::network::types::{NetworkTab, NetworkTabType}; diff --git a/src/gui/views/title_panel.rs b/src/gui/views/title_panel.rs index 43fdccf..a9cfee5 100644 --- a/src/gui/views/title_panel.rs +++ b/src/gui/views/title_panel.rs @@ -40,7 +40,7 @@ impl TitlePanel { }; (Id::from(text.clone()), false) }, - TitleType::Dual(first, second) => { + TitleType::Dual(first, _) => { let first_text = match first { TitleContentType::Title(text) => text, TitleContentType::WithSubTitle(text, _, _) => text diff --git a/src/gui/views/views.rs b/src/gui/views/views.rs index c5cbddf..0b55707 100644 --- a/src/gui/views/views.rs +++ b/src/gui/views/views.rs @@ -12,7 +12,6 @@ // See the License for the specific language governing permissions and // limitations under the License. -use std::ops::Add; use std::sync::atomic::{AtomicI32, Ordering}; use std::sync::Arc; use parking_lot::RwLock; @@ -558,7 +557,6 @@ impl View { pub fn radio_value(ui: &mut egui::Ui, current: &mut T, value: T, text: String) { let mut response = ui.radio(*current == value, text) .on_hover_cursor(CursorIcon::PointingHand); - ; if Self::touched(ui, response.clone()) && *current != value { *current = value; response.mark_changed(); @@ -650,7 +648,7 @@ pub extern "C" fn Java_mw_gri_android_MainActivity_onInput( _class: jni::objects::JObject, char: jni::sys::jstring ) { - use jni::objects::{JString}; + use jni::objects::JString; unsafe { let j_obj = JString::from_raw(char); diff --git a/src/gui/views/wallets/content.rs b/src/gui/views/wallets/content.rs index c91c2d9..7fef942 100644 --- a/src/gui/views/wallets/content.rs +++ b/src/gui/views/wallets/content.rs @@ -13,7 +13,7 @@ // limitations under the License. use std::time::Duration; -use egui::{Align, Id, Layout, Margin, RichText, Rounding, ScrollArea, Widget}; +use egui::{Align, Id, Layout, Margin, RichText, Rounding, ScrollArea}; use crate::AppConfig; use crate::gui::Colors; @@ -272,7 +272,7 @@ impl WalletsContent { }; // Draw title panel. - TitlePanel::ui(title_content, |ui, frame| { + TitlePanel::ui(title_content, |ui, _| { if show_wallet && !dual_panel { View::title_button(ui, ARROW_LEFT, || { self.wallets.select(None); @@ -296,7 +296,7 @@ impl WalletsContent { Root::toggle_network_panel(); }); }; - }, |ui, frame| { + }, |ui, _| { View::title_button(ui, GEAR, || { // Show settings modal. Modal::new(Root::SETTINGS_MODAL) diff --git a/src/gui/views/wallets/creation/creation.rs b/src/gui/views/wallets/creation/creation.rs index a4d8b64..3975306 100644 --- a/src/gui/views/wallets/creation/creation.rs +++ b/src/gui/views/wallets/creation/creation.rs @@ -12,13 +12,12 @@ // See the License for the specific language governing permissions and // limitations under the License. -use egui::{Id, Margin, RichText, ScrollArea, TextStyle, vec2, Widget}; -use egui_extras::{RetainedImage, Size, StripBuilder}; +use egui::{Id, Margin, RichText, ScrollArea, vec2}; use grin_util::ZeroingString; use crate::built_info; use crate::gui::Colors; -use crate::gui::icons::{CHECK, CLIPBOARD_TEXT, COPY, EYE, EYE_SLASH, FOLDER_PLUS, SCAN, SHARE_FAT}; +use crate::gui::icons::{CHECK, CLIPBOARD_TEXT, COPY, FOLDER_PLUS, SCAN, SHARE_FAT}; use crate::gui::platform::PlatformCallbacks; use crate::gui::views::{Modal, Root, View}; use crate::gui::views::types::{ModalPosition, TextEditOptions}; diff --git a/src/gui/views/wallets/setup/common.rs b/src/gui/views/wallets/setup/common.rs index 878392e..bc24f36 100644 --- a/src/gui/views/wallets/setup/common.rs +++ b/src/gui/views/wallets/setup/common.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use egui::{Id, RichText, Widget}; +use egui::{Id, RichText}; use crate::gui::Colors; use crate::gui::icons::{CLOCK_COUNTDOWN, PASSWORD, PENCIL}; @@ -201,7 +201,7 @@ impl CommonSetup { }); columns[1].vertical_centered_justified(|ui| { // Save button callback. - let mut on_save = || { + let on_save = || { if !self.name_edit.is_empty() { wallet.change_name(self.name_edit.clone()); cb.hide_keyboard(); @@ -358,7 +358,7 @@ impl CommonSetup { }); columns[1].vertical_centered_justified(|ui| { // Save button callback. - let mut on_save = || { + let on_save = || { if let Ok(min_conf) = self.min_confirmations_edit.parse::() { wallet.update_min_confirmations(min_conf); cb.hide_keyboard(); diff --git a/src/gui/views/wallets/setup/connection.rs b/src/gui/views/wallets/setup/connection.rs index 0664ba3..0284bd7 100644 --- a/src/gui/views/wallets/setup/connection.rs +++ b/src/gui/views/wallets/setup/connection.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use egui::{Align, Id, Layout, RichText, Rounding, Widget}; +use egui::{Align, Id, Layout, RichText, Rounding}; use url::Url; use crate::gui::Colors; @@ -412,7 +412,7 @@ impl ConnectionSetup { ui: &mut egui::Ui, wallet: &Wallet, modal: &Modal, - cb: &dyn PlatformCallbacks) { + _: &dyn PlatformCallbacks) { ui.add_space(8.0); ui.vertical_centered(|ui| { ui.label(RichText::new(t!("wallets.change_server_confirmation")) diff --git a/src/gui/views/wallets/setup/recovery.rs b/src/gui/views/wallets/setup/recovery.rs index 49a24c8..0278aaa 100644 --- a/src/gui/views/wallets/setup/recovery.rs +++ b/src/gui/views/wallets/setup/recovery.rs @@ -12,7 +12,7 @@ // See the License for the specific language governing permissions and // limitations under the License. -use egui::{Id, RichText, Widget}; +use egui::{Id, RichText}; use grin_chain::SyncStatus; use grin_util::ZeroingString; diff --git a/src/gui/views/wallets/wallet/content.rs b/src/gui/views/wallets/wallet/content.rs index 49dcf44..92cead8 100644 --- a/src/gui/views/wallets/wallet/content.rs +++ b/src/gui/views/wallets/wallet/content.rs @@ -13,7 +13,7 @@ // limitations under the License. use std::time::Duration; -use egui::{Align, Id, Layout, Margin, RichText, ScrollArea, Widget}; +use egui::{Align, Id, Layout, Margin, RichText, ScrollArea}; use grin_chain::SyncStatus; use grin_core::core::amount_to_hr_string; diff --git a/src/tor/tor.rs b/src/tor/tor.rs index 0ab7971..8453dbe 100644 --- a/src/tor/tor.rs +++ b/src/tor/tor.rs @@ -225,7 +225,6 @@ impl Tor { runtime .spawn(async move { loop { - println!("start loop"); // Create client. let (client, _) = Self::build_client(client_runtime.clone()).await; @@ -234,19 +233,16 @@ impl Tor { let tor_connector = ArtiHttpConnector::new(client, tls_connector); let http = hyper::Client::builder().build::<_, Body>(tor_connector); - println!("start get {}", url); match http.get(Uri::from_str(url.as_str()).unwrap()).await { Ok(_) => { // Remove service from starting. let mut w_services = TOR_SERVER_STATE.starting_services.write().unwrap(); w_services.remove(&service_id); - println!("OK"); }, Err(e) => { // Put service to starting. let mut w_services = TOR_SERVER_STATE.starting_services.write().unwrap(); w_services.insert(service_id.clone()); - println!("err: {}", e); }, } if !Self::is_service_running(&service_id) && @@ -305,7 +301,6 @@ impl Tor { w_services.remove(&id); } Err(e) => { - eprintln!("service err: {}", e); // Remove service from running. let mut w_services = TOR_SERVER_STATE.running_services.write().unwrap();