From 529d52534c300aec4a6e3e9e08f9762a401f7086 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Thu, 25 May 2023 11:16:16 +0200 Subject: added more progress --- src/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) (limited to 'src/lib.rs') 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::*; use error::{ErrorType, MLError, MLE}; use serde::{Deserialize, Serialize}; +pub static TICK_CHARS: &str = "#>-"; + #[derive(Debug, Clone, PartialEq, Eq, Deserialize, Serialize)] pub enum Modloader { #[serde(rename(serialize = "fabric", deserialize = "fabric"))] @@ -64,7 +66,7 @@ pub async fn check_game_versions(path: &str, force: bool) -> MLE<()> { let versions = get_game_versions().await; remove_file(path)?; let mut file = File::create(path)?; - file.write_all(&serde_json::to_string_pretty(&versions)?.as_bytes())?; + file.write_all(serde_json::to_string_pretty(&versions)?.as_bytes())?; println!(" ✓"); Ok(()) } @@ -105,7 +107,7 @@ impl VersionLevel { Ok(snapshot.version) }, VersionLevel::Version(v) => { - if versions.find(|ver| ver.version == v).is_some() { + if versions.any(|ver| ver.version == v) { Ok(v) } else { Err(MLError::new(ErrorType::ConfigError, "unknown minecraft version")) -- cgit v1.2.3