diff options
author | fxqnlr <[email protected]> | 2023-05-25 11:16:16 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2023-05-25 11:16:16 +0200 |
commit | 529d52534c300aec4a6e3e9e08f9762a401f7086 (patch) | |
tree | 463d3538dd295bbf6416ca3f141a1395d6cd1b76 /src/lib.rs | |
parent | 016e1d8d760113a64afcc5d516f08010cb566d68 (diff) | |
download | modlist-529d52534c300aec4a6e3e9e08f9762a401f7086.tar modlist-529d52534c300aec4a6e3e9e08f9762a401f7086.tar.gz modlist-529d52534c300aec4a6e3e9e08f9762a401f7086.zip |
added more progress
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 6 |
1 files changed, 4 insertions, 2 deletions
@@ -14,6 +14,8 @@ pub use commands::*; | |||
14 | use error::{ErrorType, MLError, MLE}; | 14 | use error::{ErrorType, MLError, MLE}; |
15 | use serde::{Deserialize, Serialize}; | 15 | use serde::{Deserialize, Serialize}; |
16 | 16 | ||
17 | pub static TICK_CHARS: &str = "#>-"; | ||
18 | |||
17 | #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] | 19 | #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] |
18 | pub enum Modloader { | 20 | pub 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")) |