diff options
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 14 |
1 files changed, 7 insertions, 7 deletions
@@ -3,6 +3,7 @@ pub mod config; | |||
3 | pub mod commands; | 3 | pub mod commands; |
4 | pub mod input; | 4 | pub mod input; |
5 | pub mod db; | 5 | pub mod db; |
6 | pub mod error; | ||
6 | 7 | ||
7 | use std::io::{Error, ErrorKind}; | 8 | use 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 { | |
28 | pub 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 | } |