Clippy pedantic (#1963)

Address a few pedantic lints

lints are separated into separate commits so they can be reviewed
individually.

I've not added enforcement for any of these lints, but that could be
added if desirable.
This commit is contained in:
danieleades 2024-02-25 19:04:05 +00:00 committed by GitHub
parent b052291685
commit 8d721830db
No known key found for this signature in database
GPG key ID: B5690EEEBB952194
68 changed files with 635 additions and 673 deletions

View file

@ -47,10 +47,10 @@ impl PythonRequirement {
// If the dist is a source distribution, and doesn't support the installed Python
// version, return the failing version specifiers, since we won't be able to build it.
if matches!(dist.for_installation().dist, Dist::Source(_)) {
if !requires_python.contains(self.installed()) {
return Some(requires_python);
}
if matches!(dist.for_installation().dist, Dist::Source(_))
&& !requires_python.contains(self.installed())
{
return Some(requires_python);
}
// Validate the resolved file.
@ -60,10 +60,10 @@ impl PythonRequirement {
// version, return the failing version specifiers, since we won't be able to build it.
// This isn't strictly necessary, since if `dist.resolve_metadata()` is a source distribution, it
// should be the same file as `dist.install_metadata()` (validated above).
if matches!(dist.for_resolution().dist, Dist::Source(_)) {
if !requires_python.contains(self.installed()) {
return Some(requires_python);
}
if matches!(dist.for_resolution().dist, Dist::Source(_))
&& !requires_python.contains(self.installed())
{
return Some(requires_python);
}
None