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,4 @@
use std::collections::HashMap;
use std::{collections::HashMap, fmt::Write};
use actix_http::StatusCode;
use actix_web::{
@@ -363,13 +363,13 @@ impl ApiProject for ApiV3 {
featured = featured
);
if let Some(title) = title {
url.push_str(&format!("&title={title}"));
write!(&mut url, "&title={title}").unwrap();
}
if let Some(description) = description {
url.push_str(&format!("&description={description}"));
write!(&mut url, "&description={description}").unwrap();
}
if let Some(ordering) = ordering {
url.push_str(&format!("&ordering={ordering}"));
write!(&mut url, "&ordering={ordering}").unwrap();
}
let req = test::TestRequest::post()
@@ -394,11 +394,12 @@ impl ApiProject for ApiV3 {
);
for (key, value) in patch {
url.push_str(&format!(
write!(
&mut url,
"&{key}={value}",
key = key,
value = urlencoding::encode(&value)
));
)
.unwrap();
}
let req = test::TestRequest::patch()
@@ -593,17 +594,17 @@ impl ApiV3 {
let start_date = start_date.to_rfc3339();
// let start_date = serde_json::to_string(&start_date).unwrap();
let start_date = urlencoding::encode(&start_date);
extra_args.push_str(&format!("&start_date={start_date}"));
write!(&mut extra_args, "&start_date={start_date}").unwrap();
}
if let Some(end_date) = end_date {
let end_date = end_date.to_rfc3339();
// let end_date = serde_json::to_string(&end_date).unwrap();
let end_date = urlencoding::encode(&end_date);
extra_args.push_str(&format!("&end_date={end_date}"));
write!(&mut extra_args, "&end_date={end_date}").unwrap();
}
if let Some(resolution_minutes) = resolution_minutes {
extra_args
.push_str(&format!("&resolution_minutes={resolution_minutes}"));
write!(&mut extra_args, "&resolution_minutes={resolution_minutes}")
.unwrap();
}
let req = test::TestRequest::get()