From 87947ce38476e7a5fb8d4db1bc9e0b584aa965ca Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Wed, 3 May 2023 08:29:31 +0200 Subject: added async trait? WHY --- src/lib.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) (limited to 'src/lib.rs') diff --git a/src/lib.rs b/src/lib.rs index b48bf61..f18bdfb 100644 --- a/src/lib.rs +++ b/src/lib.rs @@ -76,7 +76,7 @@ pub fn load_game_versions(path: &str) -> MLE> { let versions: Vec = serde_json::from_str(&data)?; Ok(versions) } - + impl VersionLevel { pub fn from(str: &str) -> Self { @@ -87,8 +87,9 @@ impl VersionLevel { } } - pub fn get(self, versions_path: &str) -> MLE { + pub async fn get(self, versions_path: &str, force_update: bool) -> MLE { let path = format!("{}/versions.json", versions_path); + check_game_versions(&path, force_update).await?; let mut versions = load_game_versions(&path)?.into_iter(); match self { -- cgit v1.2.3