summaryrefslogtreecommitdiff
path: root/src/apis
diff options
context:
space:
mode:
authorfxqnlr <[email protected]>2023-05-29 18:01:12 +0200
committerfxqnlr <[email protected]>2023-05-29 18:01:12 +0200
commitc7ecf3019a75dc0ab1a0aefeb9b880899fc8a231 (patch)
tree116075aaa57c35afca2749719d450c3cb473ab3e /src/apis
parent7755c9acf6b8a1d81c03ef1138e80a162f36e743 (diff)
downloadmodlist-c7ecf3019a75dc0ab1a0aefeb9b880899fc8a231.tar
modlist-c7ecf3019a75dc0ab1a0aefeb9b880899fc8a231.tar.gz
modlist-c7ecf3019a75dc0ab1a0aefeb9b880899fc8a231.zip
cargo fmt and add fmt file
Diffstat (limited to 'src/apis')
-rw-r--r--src/apis/modrinth.rs10
1 files changed, 8 insertions, 2 deletions
diff --git a/src/apis/modrinth.rs b/src/apis/modrinth.rs
index fb3952d..9a22633 100644
--- a/src/apis/modrinth.rs
+++ b/src/apis/modrinth.rs
@@ -130,7 +130,10 @@ pub enum GameVersionType {
130 beta, 130 beta,
131} 131}
132 132
133async fn get(api: &str, path: &str) -> Result<Option<Vec<u8>>, Box<dyn std::error::Error>> { 133async fn get(
134 api: &str,
135 path: &str,
136) -> Result<Option<Vec<u8>>, Box<dyn std::error::Error>> {
134 let url = format!(r#"{}{}"#, api, path); 137 let url = format!(r#"{}{}"#, api, path);
135 138
136 let client = Client::builder() 139 let client = Client::builder()
@@ -182,7 +185,10 @@ pub async fn versions(api: &str, id: String, list: List) -> Vec<Version> {
182} 185}
183 186
184///Get version with the version ids 187///Get version with the version ids
185pub async fn get_raw_versions(api: &str, versions: Vec<String>) -> Vec<Version> { 188pub async fn get_raw_versions(
189 api: &str,
190 versions: Vec<String>,
191) -> Vec<Version> {
186 let url = format!(r#"versions?ids=["{}"]"#, versions.join(r#"",""#)); 192 let url = format!(r#"versions?ids=["{}"]"#, versions.join(r#"",""#));
187 193
188 let data = get(api, &url).await.unwrap().unwrap(); 194 let data = get(api, &url).await.unwrap().unwrap();