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::sync::LazyLock;
use std::{fmt::Write, sync::LazyLock};
use itertools::Itertools;
use regex::Regex;
@@ -44,15 +44,17 @@ pub fn validation_errors_to_string(
ValidationErrorsKind::Field(errors) => {
if let Some(error) = errors.first() {
if let Some(adder) = adder {
output.push_str(&format!(
"Field {} {} failed validation with error: {}",
field, adder, error.code
));
write!(
&mut output,
"Field {field} {adder} failed validation with error: {}",
error.code
).unwrap();
} else {
output.push_str(&format!(
"Field {} failed validation with error: {}",
field, error.code
));
write!(
&mut output,
"Field {field} failed validation with error: {}",
error.code
).unwrap();
}
}