Skip to content

Commit

Permalink
fix clippy::pedantic lint
Browse files Browse the repository at this point in the history
  • Loading branch information
GyulyVGC committed Nov 24, 2024
1 parent 07fad71 commit 3277264
Show file tree
Hide file tree
Showing 2 changed files with 6 additions and 3 deletions.
5 changes: 3 additions & 2 deletions src/configs/types/configs.rs
Original file line number Diff line number Diff line change
@@ -1,7 +1,7 @@
use crate::{ConfigDevice, ConfigSettings, ConfigWindow};
use once_cell::sync::Lazy;

pub static CONFIGS: Lazy<Configs> = Lazy::new(|| Configs::load());
pub static CONFIGS: Lazy<Configs> = Lazy::new(Configs::load);

#[derive(Default, Clone, PartialEq, Debug)]
pub struct Configs {
Expand All @@ -11,7 +11,8 @@ pub struct Configs {
}

impl Configs {
/// This shouldn't be used directly outside tests, use `CONFIGS` instead
/// This should only be used directly to load fresh configs;
/// use `CONFIGS` instead to access the initial instance
pub fn load() -> Self {
Configs {
settings: ConfigSettings::load(),
Expand Down
4 changes: 3 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -55,9 +55,11 @@ pub const SNIFFNET_TITLECASE: &str = "Sniffnet";
///
/// It initializes shared variables and loads configuration parameters
pub fn main() -> iced::Result {
let configs = CONFIGS.clone();

let boot_task_chain = parse_cli_args();

let configs1 = Arc::new(Mutex::new(CONFIGS.clone()));
let configs1 = Arc::new(Mutex::new(configs));
let configs2 = configs1.clone();

let newer_release_available1 = Arc::new(Mutex::new(None));
Expand Down

0 comments on commit 3277264

Please sign in to comment.