diff options
author | fxqnlr <[email protected]> | 2023-05-26 17:40:27 +0200 |
---|---|---|
committer | fxqnlr <[email protected]> | 2023-05-26 17:40:27 +0200 |
commit | 2d7e0a2fbf1c8a4187e2bf3fdcd592631ab273a0 (patch) | |
tree | cc8f3522670245775e4be7ac2a1e2ad4fd818c8f /src/apis | |
parent | d8554e30029bf43dccce72e982784cd01857b0c4 (diff) | |
download | modlist-2d7e0a2fbf1c8a4187e2bf3fdcd592631ab273a0.tar modlist-2d7e0a2fbf1c8a4187e2bf3fdcd592631ab273a0.tar.gz modlist-2d7e0a2fbf1c8a4187e2bf3fdcd592631ab273a0.zip |
added full progress? cargo fmt
Diffstat (limited to 'src/apis')
-rw-r--r-- | src/apis/modrinth.rs | 7 |
1 files changed, 5 insertions, 2 deletions
diff --git a/src/apis/modrinth.rs b/src/apis/modrinth.rs index 14ff266..fb3952d 100644 --- a/src/apis/modrinth.rs +++ b/src/apis/modrinth.rs | |||
@@ -127,7 +127,7 @@ pub enum GameVersionType { | |||
127 | release, | 127 | release, |
128 | snapshot, | 128 | snapshot, |
129 | alpha, | 129 | alpha, |
130 | beta | 130 | beta, |
131 | } | 131 | } |
132 | 132 | ||
133 | async fn get(api: &str, path: &str) -> Result<Option<Vec<u8>>, Box<dyn std::error::Error>> { | 133 | async fn get(api: &str, path: &str) -> Result<Option<Vec<u8>>, Box<dyn std::error::Error>> { |
@@ -208,7 +208,10 @@ pub fn extract_current_version(versions: Vec<Version>) -> MLE<String> { | |||
208 | } | 208 | } |
209 | 209 | ||
210 | pub async fn get_game_versions() -> Vec<GameVersion> { | 210 | pub async fn get_game_versions() -> Vec<GameVersion> { |
211 | let data = get("https://api.modrinth.com/v2/", "tag/game_version").await.unwrap().unwrap(); | 211 | let data = get("https://api.modrinth.com/v2/", "tag/game_version") |
212 | .await | ||
213 | .unwrap() | ||
214 | .unwrap(); | ||
212 | 215 | ||
213 | serde_json::from_slice(&data).unwrap() | 216 | serde_json::from_slice(&data).unwrap() |
214 | } | 217 | } |