chore(clippy): enable and fix many stricter lints (#3783)

* chore(clippy): enable and fix many stricter lints

These ensure that the codebase uses more idiomatic, performant, and
concise language constructions.

* chore: make non-Clippy compiler warnings also deny by default
This commit is contained in:
Alejandro González
2025-06-14 02:10:12 +02:00
committed by GitHub
parent 301967d204
commit f84f8c1c2b
106 changed files with 542 additions and 760 deletions

View File

@@ -1,4 +1,5 @@
use std::collections::HashMap;
use std::fmt::Write;
use super::{
ApiV2,
@@ -383,32 +384,36 @@ impl ApiVersion for ApiV2 {
) -> ServiceResponse {
let mut query_string = String::new();
if let Some(game_versions) = game_versions {
query_string.push_str(&format!(
write!(
&mut query_string,
"&game_versions={}",
urlencoding::encode(
&serde_json::to_string(&game_versions).unwrap()
)
));
)
.unwrap();
}
if let Some(loaders) = loaders {
query_string.push_str(&format!(
write!(
&mut query_string,
"&loaders={}",
urlencoding::encode(&serde_json::to_string(&loaders).unwrap())
));
)
.unwrap();
}
if let Some(featured) = featured {
query_string.push_str(&format!("&featured={featured}"));
write!(&mut query_string, "&featured={featured}").unwrap();
}
if let Some(version_type) = version_type {
query_string.push_str(&format!("&version_type={version_type}"));
write!(&mut query_string, "&version_type={version_type}").unwrap();
}
if let Some(limit) = limit {
let limit = limit.to_string();
query_string.push_str(&format!("&limit={limit}"));
write!(&mut query_string, "&limit={limit}").unwrap();
}
if let Some(offset) = offset {
let offset = offset.to_string();
query_string.push_str(&format!("&offset={offset}"));
write!(&mut query_string, "&offset={offset}").unwrap();
}
let req = test::TestRequest::get()