aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe/src/dependency_resolver/pool.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-06-20 01:16:50 +0900
committernsfisis <nsfisis@gmail.com>2026-06-20 02:22:41 +0900
commitefec43b3b8827820cf35fe1b73d8e33f5fe84eb4 (patch)
treea62bbba72324de48be5f8e689559f8d9e288fc61 /crates/shirabe/src/dependency_resolver/pool.rs
parentcac18ef73a39b4ac41fa4d6ccb753804d4c42cb7 (diff)
downloadphp-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.tar.gz
php-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.tar.zst
php-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.zip
refactor: auto-fix clippy warnings
Diffstat (limited to 'crates/shirabe/src/dependency_resolver/pool.rs')
-rw-r--r--crates/shirabe/src/dependency_resolver/pool.rs64
1 files changed, 32 insertions, 32 deletions
diff --git a/crates/shirabe/src/dependency_resolver/pool.rs b/crates/shirabe/src/dependency_resolver/pool.rs
index b12d760..7b60002 100644
--- a/crates/shirabe/src/dependency_resolver/pool.rs
+++ b/crates/shirabe/src/dependency_resolver/pool.rs
@@ -120,12 +120,12 @@ impl Pool {
.get(package_name)
.unwrap_or(&empty);
for (version, _package_with_security_advisories) in versions {
- if let Some(c) = constraint {
- if c.matches(
+ if let Some(c) = constraint
+ && c.matches(
&SimpleConstraint::new("==".to_string(), version.to_string(), None).into(),
- ) {
- return true;
- }
+ )
+ {
+ return true;
}
}
@@ -144,15 +144,15 @@ impl Pool {
.get(package_name)
.unwrap_or(&empty);
for (version, package_with_security_advisories) in versions {
- if let Some(c) = constraint {
- if c.matches(
+ if let Some(c) = constraint
+ && c.matches(
&SimpleConstraint::new("==".to_string(), version.to_string(), None).into(),
- ) {
- return package_with_security_advisories
- .iter()
- .map(|advisory| advisory.advisory_id().to_string())
- .collect();
- }
+ )
+ {
+ return package_with_security_advisories
+ .iter()
+ .map(|advisory| advisory.advisory_id().to_string())
+ .collect();
}
}
@@ -170,12 +170,12 @@ impl Pool {
.get(package_name)
.unwrap_or(&empty);
for (version, _pretty_version) in versions {
- if let Some(c) = constraint {
- if c.matches(
+ if let Some(c) = constraint
+ && c.matches(
&SimpleConstraint::new("==".to_string(), version.to_string(), None).into(),
- ) {
- return true;
- }
+ )
+ {
+ return true;
}
}
@@ -207,7 +207,7 @@ impl Pool {
for provided in package.get_names(true) {
self.package_by_name
.entry(provided)
- .or_insert_with(Vec::new)
+ .or_default()
.push(package.clone());
}
@@ -241,16 +241,16 @@ impl Pool {
Some(c) => c.to_string(),
None => String::new(),
};
- if let Some(by_key) = self.provider_cache.get(name) {
- if let Some(cached) = by_key.get(&key) {
- return cached.clone();
- }
+ if let Some(by_key) = self.provider_cache.get(name)
+ && let Some(cached) = by_key.get(&key)
+ {
+ return cached.clone();
}
let computed = self.compute_what_provides(name, constraint);
self.provider_cache
.entry(name.to_string())
- .or_insert_with(IndexMap::new)
+ .or_default()
.insert(key, computed.clone());
computed
}
@@ -352,16 +352,16 @@ impl Pool {
return false;
}
- if let Some(provide) = provides.get(name) {
- if constraint.is_none() || constraint.unwrap().matches(provide.get_constraint()) {
- return true;
- }
+ if let Some(provide) = provides.get(name)
+ && (constraint.is_none() || constraint.unwrap().matches(provide.get_constraint()))
+ {
+ return true;
}
- if let Some(replace) = replaces.get(name) {
- if constraint.is_none() || constraint.unwrap().matches(replace.get_constraint()) {
- return true;
- }
+ if let Some(replace) = replaces.get(name)
+ && (constraint.is_none() || constraint.unwrap().matches(replace.get_constraint()))
+ {
+ return true;
}
false