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

@@ -28,14 +28,11 @@ impl super::Validator for ModpackValidator {
archive: &mut ZipArchive<Cursor<bytes::Bytes>>,
) -> Result<ValidationResult, ValidationError> {
let pack: PackFormat = {
let mut file =
if let Ok(file) = archive.by_name("modrinth.index.json") {
file
} else {
return Ok(ValidationResult::Warning(
"Pack manifest is missing.",
));
};
let Ok(mut file) = archive.by_name("modrinth.index.json") else {
return Ok(ValidationResult::Warning(
"Pack manifest is missing.",
));
};
let mut contents = String::new();
file.read_to_string(&mut contents)?;
@@ -109,7 +106,7 @@ impl super::Validator for ModpackValidator {
|| x.starts_with("overrides/shaderpacks")
|| x.starts_with("client-overrides/shaderpacks"))
})
.flat_map(|x| x.rsplit('/').next().map(|x| x.to_string()))
.filter_map(|x| x.rsplit('/').next().map(|x| x.to_string()))
.collect::<Vec<String>>(),
})
}