From f5e070cdf6628a5ebd981d373929802317104e24 Mon Sep 17 00:00:00 2001 From: fxqnlr Date: Wed, 4 Sep 2024 09:56:42 +0200 Subject: clippy --fix --- src/apis/modrinth.rs | 10 +++++----- 1 file changed, 5 insertions(+), 5 deletions(-) (limited to 'src/apis') diff --git a/src/apis/modrinth.rs b/src/apis/modrinth.rs index 9a22633..5366f3d 100644 --- a/src/apis/modrinth.rs +++ b/src/apis/modrinth.rs @@ -134,7 +134,7 @@ async fn get( api: &str, path: &str, ) -> Result>, Box> { - let url = format!(r#"{}{}"#, api, path); + let url = format!(r#"{api}{path}"#); let client = Client::builder() .user_agent(format!( @@ -154,7 +154,7 @@ async fn get( } pub async fn project(api: &str, name: &str) -> Project { - let url = format!("project/{}", name); + let url = format!("project/{name}"); let data = get(api, &url).await.unwrap().unwrap(); serde_json::from_slice(&data).unwrap() @@ -162,14 +162,14 @@ pub async fn project(api: &str, name: &str) -> Project { pub async fn projects(api: &str, ids: Vec) -> Vec { let all = ids.join(r#"",""#); - let url = format!(r#"projects?ids=["{}"]"#, all); + let url = format!(r#"projects?ids=["{all}"]"#); let data = get(api, &url).await.unwrap().unwrap(); serde_json::from_slice(&data).unwrap() } -///Get applicable versions from mod_id with list context +///Get applicable versions from `mod_id` with list context pub async fn versions(api: &str, id: String, list: List) -> Vec { let url = format!( r#"project/{}/version?loaders=["{}"]&game_versions=["{}"]"#, @@ -203,7 +203,7 @@ pub fn extract_current_version(versions: Vec) -> MLE { let mut times: Vec<(String, DateTime)> = vec![]; for ver in versions { let stamp = DateTime::parse_from_rfc3339(&ver.date_published)?; - times.push((ver.id, stamp)) + times.push((ver.id, stamp)); } times.sort_by_key(|t| t.1); times.reverse(); -- cgit v1.2.3