You've already forked AstralRinth
forked from didirus/AstralRinth
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:
committed by
GitHub
parent
301967d204
commit
f84f8c1c2b
@@ -77,7 +77,6 @@ pub enum SupportedGameVersions {
|
||||
All,
|
||||
PastDate(DateTime<Utc>),
|
||||
Range(DateTime<Utc>, DateTime<Utc>),
|
||||
#[allow(dead_code)]
|
||||
Custom(Vec<MinecraftGameVersion>),
|
||||
}
|
||||
|
||||
@@ -232,8 +231,7 @@ fn game_version_supported(
|
||||
all_game_versions
|
||||
.iter()
|
||||
.find(|y| y.version == x.version)
|
||||
.map(|x| x.created > date)
|
||||
.unwrap_or(false)
|
||||
.is_some_and(|x| x.created > date)
|
||||
})
|
||||
}
|
||||
SupportedGameVersions::Range(before, after) => {
|
||||
@@ -241,8 +239,7 @@ fn game_version_supported(
|
||||
all_game_versions
|
||||
.iter()
|
||||
.find(|y| y.version == x.version)
|
||||
.map(|x| x.created > before && x.created < after)
|
||||
.unwrap_or(false)
|
||||
.is_some_and(|x| x.created > before && x.created < after)
|
||||
})
|
||||
}
|
||||
SupportedGameVersions::Custom(versions) => {
|
||||
|
||||
@@ -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>>(),
|
||||
})
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user