summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
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}