diff options
author | fxqnlr <[email protected]> | 2023-05-03 08:29:31 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2023-05-03 08:29:31 +0200 |
commit | 87947ce38476e7a5fb8d4db1bc9e0b584aa965ca (patch) | |
tree | cc6a289d573faf83cfbd23d7a66bc2c9066b767d /src/lib.rs | |
parent | 245b6b9926033acd750503ab4947c9514c5e1aa6 (diff) | |
download | modlist-87947ce38476e7a5fb8d4db1bc9e0b584aa965ca.tar modlist-87947ce38476e7a5fb8d4db1bc9e0b584aa965ca.tar.gz modlist-87947ce38476e7a5fb8d4db1bc9e0b584aa965ca.zip |
added async trait? WHY
Diffstat (limited to 'src/lib.rs')
-rw-r--r-- | src/lib.rs | 5 |
1 files changed, 3 insertions, 2 deletions
@@ -76,7 +76,7 @@ pub fn load_game_versions(path: &str) -> MLE<Vec<GameVersion>> { | |||
76 | let versions: Vec<GameVersion> = serde_json::from_str(&data)?; | 76 | let versions: Vec<GameVersion> = serde_json::from_str(&data)?; |
77 | Ok(versions) | 77 | Ok(versions) |
78 | } | 78 | } |
79 | 79 | ||
80 | impl VersionLevel { | 80 | impl VersionLevel { |
81 | 81 | ||
82 | pub fn from(str: &str) -> Self { | 82 | pub fn from(str: &str) -> Self { |
@@ -87,8 +87,9 @@ impl VersionLevel { | |||
87 | } | 87 | } |
88 | } | 88 | } |
89 | 89 | ||
90 | pub fn get(self, versions_path: &str) -> MLE<String> { | 90 | pub async fn get(self, versions_path: &str, force_update: bool) -> MLE<String> { |
91 | let path = format!("{}/versions.json", versions_path); | 91 | let path = format!("{}/versions.json", versions_path); |
92 | check_game_versions(&path, force_update).await?; | ||
92 | let mut versions = load_game_versions(&path)?.into_iter(); | 93 | let mut versions = load_game_versions(&path)?.into_iter(); |
93 | 94 | ||
94 | match self { | 95 | match self { |