summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2022-11-17 21:20:09 +0100
committerfxqnlr <[email protected]>2022-11-17 21:20:09 +0100
commitfdd7525e5a0d298ebb8a9aa81cc19ec79e8cd113 (patch)
treeec7c7c80434b339f9442882f1e2dce6f60cc9edd /src/lib.rs
parent5145dd23f1777180d8003e76f59af57643796516 (diff)
downloadmodlist-fdd7525e5a0d298ebb8a9aa81cc19ec79e8cd113.tar
modlist-fdd7525e5a0d298ebb8a9aa81cc19ec79e8cd113.tar.gz
modlist-fdd7525e5a0d298ebb8a9aa81cc19ec79e8cd113.zip
added --clean for update && list downloadfolder
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs14
1 files changed, 7 insertions, 7 deletions
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;
3pub mod commands; 3pub mod commands;
4pub mod input; 4pub mod input;
5pub mod db; 5pub mod db;
6pub mod error;
6 7
7use std::io::{Error, ErrorKind}; 8use std::io::{Error, ErrorKind};
8 9
@@ -23,12 +24,11 @@ impl Modloader {
23 } 24 }
24 } 25 }
25 26
26} 27 fn from(string: &str) -> Result<Modloader, Box<Error>> {
27 28 match string {
28pub fn get_modloader(string: String) -> Result<Modloader, Box<dyn std::error::Error>> { 29 "forge" => Ok(Modloader::Forge),
29 match string.as_str() { 30 "fabric" => Ok(Modloader::Fabric),
30 "forge" => Ok(Modloader::Forge), 31 _ => Err(Box::new(Error::new(ErrorKind::InvalidData, "UNKNOWN_MODLOADER")))
31 "fabric" => Ok(Modloader::Fabric), 32 }
32 _ => Err(Box::new(Error::new(ErrorKind::InvalidData, "UNKNOWN_MODLOADER")))
33 } 33 }
34} 34}