From 5f69e460cd47fdf77a3f63b47d614bef8ca642ba Mon Sep 17 00:00:00 2001 From: shibedrill <53824200+shibedrill@users.noreply.github.com> Date: Mon, 22 Apr 2024 16:59:07 -0400 Subject: [PATCH] Fixed ugly config init --- src/main.rs | 6 +++--- src/settings.rs | 2 -- 2 files changed, 3 insertions(+), 5 deletions(-) diff --git a/src/main.rs b/src/main.rs index 2279180..fba60af 100644 --- a/src/main.rs +++ b/src/main.rs @@ -43,9 +43,9 @@ async fn main() { pretty_env_logger::init(); // Configure persistent options - let config = Settings { channels: vec![] }; - let config_manager = Arc::new(Mutex::new(SettingsManager::manage("settings.json", config))); - config_manager.lock().await.update(); + let config_manager: Arc>> = Arc::new(Mutex::new( + SettingsManager::load("settings.json").expect("Unable to load config!"), + )); // Set up framework let framework = poise::Framework::builder() diff --git a/src/settings.rs b/src/settings.rs index ddaa68d..c90bc4e 100644 --- a/src/settings.rs +++ b/src/settings.rs @@ -1,5 +1,3 @@ -#![allow(dead_code)] - use std::io::{Read, Write}; use std::ops::{Deref, DerefMut};