diff --git a/src-tauri/src/binary_resolver.rs b/src-tauri/src/binary_resolver.rs index d9bbfa04b..8d07d94ee 100644 --- a/src-tauri/src/binary_resolver.rs +++ b/src-tauri/src/binary_resolver.rs @@ -2,7 +2,7 @@ use crate::download_utils::{download_file_with_retries, extract, validate_checks use crate::{github, ProgressTracker}; use anyhow::{anyhow, Error}; use async_trait::async_trait; -use log::{debug, error, info, warn}; +use log::{debug, error, warn}; use regex::Regex; use semver::{Version, VersionReq}; use std::collections::HashMap; diff --git a/src-tauri/src/hardware_monitor.rs b/src-tauri/src/hardware_monitor.rs index bee027940..2c40e24e4 100644 --- a/src-tauri/src/hardware_monitor.rs +++ b/src-tauri/src/hardware_monitor.rs @@ -1,6 +1,6 @@ use std::{ops::Deref, sync::LazyLock}; -use log::{debug, info, warn}; +use log::{debug, warn}; use nvml_wrapper::{enum_wrappers::device::TemperatureSensor, Nvml}; use serde::Serialize; use sysinfo::{Component, Components, CpuRefreshKind, RefreshKind, System}; diff --git a/src-tauri/src/main.rs b/src-tauri/src/main.rs index 61c49094a..193ea7ec0 100644 --- a/src-tauri/src/main.rs +++ b/src-tauri/src/main.rs @@ -17,6 +17,7 @@ mod mm_proxy_manager; mod network_utils; mod node_adapter; mod node_manager; +mod notification_manager; mod p2pool; mod p2pool_adapter; mod p2pool_manager; @@ -32,7 +33,6 @@ mod wallet_adapter; mod wallet_manager; mod xmrig; mod xmrig_adapter; -mod notification_manager; use crate::cpu_miner::CpuMiner; use crate::gpu_miner::GpuMiner; @@ -529,10 +529,7 @@ async fn get_seed_words( } #[tauri::command] -async fn trigger_notification( - summary: &str, - body: &str, -) -> Result<(), String> { +async fn trigger_notification(summary: &str, body: &str) -> Result<(), String> { NotificationManager::current().trigger_notification(summary, body); Ok(()) } diff --git a/src-tauri/src/notification_manager.rs b/src-tauri/src/notification_manager.rs index 16ab874d2..2d943d016 100644 --- a/src-tauri/src/notification_manager.rs +++ b/src-tauri/src/notification_manager.rs @@ -1,5 +1,5 @@ -use std::sync::LazyLock; use notify_rust::Notification; +use std::sync::LazyLock; use log::info; @@ -26,11 +26,9 @@ impl NotificationManager { match Self::detect_current_os() { CurrentOperatingSystem::Linux => { #[cfg(target_os = "linux")] - notification.show().unwrap().on_close( - |notification| { - info!(target: LOG_TARGET, "Notification closed: {:?}", notification); - }, - ); + notification.show().unwrap().on_close(|notification| { + info!(target: LOG_TARGET, "Notification closed: {:?}", notification); + }); } CurrentOperatingSystem::MacOS => { #[cfg(target_os = "macos")] @@ -44,22 +42,20 @@ impl NotificationManager { } fn build_notification(&self, summary: &str, body: &str) -> Notification { - let mut notification = Notification::new() - .summary(summary) - .body(body).finalize(); + let mut notification = Notification::new().summary(summary).body(body).finalize(); match Self::detect_current_os() { CurrentOperatingSystem::Linux => { - return notification.auto_icon().appname("Tari Universe").finalize(); + notification.auto_icon().appname("Tari Universe").finalize() } CurrentOperatingSystem::MacOS => { - return notification.finalize(); + notification.finalize() } CurrentOperatingSystem::Windows => { - return notification.finalize(); + notification.finalize() + } } } - } fn detect_current_os() -> CurrentOperatingSystem { if cfg!(target_os = "windows") { CurrentOperatingSystem::Windows @@ -75,4 +71,4 @@ impl NotificationManager { pub fn current() -> &'static NotificationManager { &INSTANCE } -} \ No newline at end of file +}