From fdd7525e5a0d298ebb8a9aa81cc19ec79e8cd113 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Thu, 17 Nov 2022 21:20:09 +0100 Subject: added --clean for update && list downloadfolder --- src/lib.rs | 14 +++++++------- 1 file changed, 7 insertions(+), 7 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index 1e7ebbf..51b4487 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -3,6 +3,7 @@ pub mod config; pub mod commands; pub mod input; pub mod db; +pub mod error; use std::io::{Error, ErrorKind}; @@ -23,12 +24,11 @@ impl Modloader { } } -} - -pub fn get_modloader(string: String) -> Result> { - match string.as_str() { - "forge" => Ok(Modloader::Forge), - "fabric" => Ok(Modloader::Fabric), - _ => Err(Box::new(Error::new(ErrorKind::InvalidData, "UNKNOWN_MODLOADER"))) + fn from(string: &str) -> Result> { + match string { + "forge" => Ok(Modloader::Forge), + "fabric" => Ok(Modloader::Fabric), + _ => Err(Box::new(Error::new(ErrorKind::InvalidData, "UNKNOWN_MODLOADER"))) + } } } -- cgit v1.2.3