summaryrefslogtreecommitdiff
path: root/src/lib.rs
diff options
context:
space:
mode:
Diffstat (limited to 'src/lib.rs')
-rw-r--r--src/lib.rs6
1 files changed, 4 insertions, 2 deletions
diff --git a/src/lib.rs b/src/lib.rs
index 1c40ceb..f59ba89 100644
--- a/src/lib.rs
+++ b/src/lib.rs
@@ -14,6 +14,8 @@ pub use commands::*;
14use error::{ErrorType, MLError, MLE}; 14use error::{ErrorType, MLError, MLE};
15use serde::{Deserialize, Serialize}; 15use serde::{Deserialize, Serialize};
16 16
17pub static TICK_CHARS: &str = "#>-";
18
17#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] 19#[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)]
18pub enum Modloader { 20pub enum Modloader {
19 #[serde(rename(serialize = "fabric", deserialize = "fabric"))] 21 #[serde(rename(serialize = "fabric", deserialize = "fabric"))]
@@ -64,7 +66,7 @@ pub async fn check_game_versions(path: &str, force: bool) -> MLE<()> {
64 let versions = get_game_versions().await; 66 let versions = get_game_versions().await;
65 remove_file(path)?; 67 remove_file(path)?;
66 let mut file = File::create(path)?; 68 let mut file = File::create(path)?;
67 file.write_all(&serde_json::to_string_pretty(&versions)?.as_bytes())?; 69 file.write_all(serde_json::to_string_pretty(&versions)?.as_bytes())?;
68 println!(" ✓"); 70 println!(" ✓");
69 Ok(()) 71 Ok(())
70} 72}
@@ -105,7 +107,7 @@ impl VersionLevel {
105 Ok(snapshot.version) 107 Ok(snapshot.version)
106 }, 108 },
107 VersionLevel::Version(v) => { 109 VersionLevel::Version(v) => {
108 if versions.find(|ver| ver.version == v).is_some() { 110 if versions.any(|ver| ver.version == v) {
109 Ok(v) 111 Ok(v)
110 } else { 112 } else {
111 Err(MLError::new(ErrorType::ConfigError, "unknown minecraft version")) 113 Err(MLError::new(ErrorType::ConfigError, "unknown minecraft version"))