From 5a4914b986223d9c1d9c2006b830dd464751b089 Mon Sep 17 00:00:00 2001 From: GyulyVGC Date: Wed, 1 Jan 2025 22:45:28 +0100 Subject: [PATCH] optimize imports --- src/cli/mod.rs | 5 +++-- src/configs/types/configs.rs | 3 ++- src/gui/styles/rule.rs | 3 ++- src/gui/styles/scrollbar.rs | 7 ++++--- src/gui/styles/toggler.rs | 5 +++-- src/gui/types/message.rs | 3 ++- src/networking/types/host_data_states.rs | 10 ++++++---- 7 files changed, 22 insertions(+), 14 deletions(-) diff --git a/src/cli/mod.rs b/src/cli/mod.rs index f8e617a2..d0150551 100644 --- a/src/cli/mod.rs +++ b/src/cli/mod.rs @@ -1,10 +1,11 @@ +use clap::Parser; +use iced::{window, Task}; + use crate::gui::types::message::Message; use crate::utils::formatted_strings::APP_VERSION; use crate::Configs; use crate::CONFIGS; use crate::SNIFFNET_LOWERCASE; -use clap::Parser; -use iced::{window, Task}; #[derive(Parser, Debug)] #[command( diff --git a/src/configs/types/configs.rs b/src/configs/types/configs.rs index 79a79351..398a4d78 100644 --- a/src/configs/types/configs.rs +++ b/src/configs/types/configs.rs @@ -1,6 +1,7 @@ -use crate::{ConfigDevice, ConfigSettings, ConfigWindow}; use once_cell::sync::Lazy; +use crate::{ConfigDevice, ConfigSettings, ConfigWindow}; + pub static CONFIGS: Lazy = Lazy::new(Configs::load); #[derive(Default, Clone, PartialEq, Debug)] diff --git a/src/gui/styles/rule.rs b/src/gui/styles/rule.rs index 0cb5e083..9ce67a43 100644 --- a/src/gui/styles/rule.rs +++ b/src/gui/styles/rule.rs @@ -2,10 +2,11 @@ #![allow(clippy::module_name_repetitions)] -use crate::StyleType; use iced::widget::rule::{Catalog, FillMode, Style}; use iced::Color; +use crate::StyleType; + #[derive(Default)] pub enum RuleType { #[default] diff --git a/src/gui/styles/scrollbar.rs b/src/gui/styles/scrollbar.rs index c926055e..140f24fc 100644 --- a/src/gui/styles/scrollbar.rs +++ b/src/gui/styles/scrollbar.rs @@ -2,14 +2,15 @@ #![allow(clippy::module_name_repetitions)] -use crate::gui::styles::style_constants::BORDER_ROUNDED_RADIUS; -use crate::gui::styles::types::palette::mix_colors; -use crate::StyleType; use iced::widget::container; use iced::widget::scrollable::{Catalog, Rail, Status, Style}; use iced::widget::scrollable::{Scrollbar, Scroller}; use iced::{Background, Border, Color}; +use crate::gui::styles::style_constants::BORDER_ROUNDED_RADIUS; +use crate::gui::styles::types::palette::mix_colors; +use crate::StyleType; + #[derive(Default)] pub enum ScrollbarType { #[default] diff --git a/src/gui/styles/toggler.rs b/src/gui/styles/toggler.rs index 6aa79bff..3b85809d 100644 --- a/src/gui/styles/toggler.rs +++ b/src/gui/styles/toggler.rs @@ -2,11 +2,12 @@ #![allow(clippy::module_name_repetitions)] -use crate::gui::styles::style_constants::BORDER_WIDTH; -use crate::StyleType; use iced::widget::toggler::{Catalog, Status, Style}; use iced::Color; +use crate::gui::styles::style_constants::BORDER_WIDTH; +use crate::StyleType; + #[derive(Default)] pub enum TogglerType { #[default] diff --git a/src/gui/types/message.rs b/src/gui/types/message.rs index 1963dab9..985f8a5b 100644 --- a/src/gui/types/message.rs +++ b/src/gui/types/message.rs @@ -1,3 +1,5 @@ +use iced::window; + use crate::gui::components::types::my_modal::MyModal; use crate::gui::pages::types::running_page::RunningPage; use crate::gui::pages::types::settings_page::SettingsPage; @@ -9,7 +11,6 @@ use crate::report::types::sort_type::SortType; use crate::utils::types::file_info::FileInfo; use crate::utils::types::web_page::WebPage; use crate::{ChartType, IpVersion, Language, Protocol, ReportSortType, StyleType}; -use iced::window; #[derive(Debug, Clone)] /// Messages types that permit reacting to application interactions/subscriptions diff --git a/src/networking/types/host_data_states.rs b/src/networking/types/host_data_states.rs index a71be20a..db895106 100644 --- a/src/networking/types/host_data_states.rs +++ b/src/networking/types/host_data_states.rs @@ -1,11 +1,13 @@ -use crate::countries::types::country::Country; -use crate::networking::types::host::Host; -use crate::report::types::search_parameters::SearchParameters; -use iced::widget::combo_box; use std::collections::BTreeSet; use std::net::IpAddr; use std::sync::{Arc, Mutex}; +use iced::widget::combo_box; + +use crate::countries::types::country::Country; +use crate::networking::types::host::Host; +use crate::report::types::search_parameters::SearchParameters; + /// Struct to contain all the sets of data related to network hosts /// /// It also stores combobox states for the host-related filters