From ecc4743fdec43eb578e9c35bb008c68909f1517e Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Wed, 4 Sep 2024 17:32:19 +0200 Subject: better error handling --- src/main.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) (limited to 'src/main.rs') diff --git a/src/main.rs b/src/main.rs index 038e2f4..1b8f041 100644 --- a/src/main.rs +++ b/src/main.rs @@ -5,7 +5,7 @@ pub mod cache; pub mod commands; pub mod config; pub mod db; -pub mod error; +pub mod errors; pub mod files; pub mod data; @@ -14,7 +14,7 @@ use config::Cfg; use data::{gameversion::VersionLevel, list::List, modification::{AddMod, IDSelector}, modloader::Modloader}; pub use data::{STYLE_BAR_POS, STYLE_MESSAGE, STYLE_SPINNER, STYLE_BAR_BYTE, STYLE_OPERATION, PROGRESS_CHARS}; use db::{config_get_current_list, lists_get, lists_get_all_ids}; -use error::MLE; +use errors::MLE; #[derive(Parser)] #[command(author, version, about)] @@ -297,7 +297,7 @@ async fn handle_list( version, } => { let ml = match modloader { - Some(ml) => Modloader::from(&ml).unwrap(), + Some(ml) => Modloader::try_from(ml.as_str())?, None => config.defaults.modloader.clone(), }; -- cgit v1.2.3