diff options
| author | nsfisis <nsfisis@gmail.com> | 2026-06-20 01:16:50 +0900 |
|---|---|---|
| committer | nsfisis <nsfisis@gmail.com> | 2026-06-20 02:22:41 +0900 |
| commit | efec43b3b8827820cf35fe1b73d8e33f5fe84eb4 (patch) | |
| tree | a62bbba72324de48be5f8e689559f8d9e288fc61 /crates/shirabe/src/repository/installed_repository.rs | |
| parent | cac18ef73a39b4ac41fa4d6ccb753804d4c42cb7 (diff) | |
| download | php-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.tar.gz php-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.tar.zst php-shirabe-efec43b3b8827820cf35fe1b73d8e33f5fe84eb4.zip | |
refactor: auto-fix clippy warnings
Diffstat (limited to 'crates/shirabe/src/repository/installed_repository.rs')
| -rw-r--r-- | crates/shirabe/src/repository/installed_repository.rs | 57 |
1 files changed, 26 insertions, 31 deletions
diff --git a/crates/shirabe/src/repository/installed_repository.rs b/crates/shirabe/src/repository/installed_repository.rs index f6b9643..55ec50f 100644 --- a/crates/shirabe/src/repository/installed_repository.rs +++ b/crates/shirabe/src/repository/installed_repository.rs @@ -140,37 +140,32 @@ impl InstalledRepository { let needles_snapshot = needles.clone(); for link in package.get_replaces().values() { for needle in &needles_snapshot { - if link.get_source() == needle.as_str() { - if constraint.is_none() - || link.get_constraint().matches(constraint.as_ref().unwrap()) - { - if packages_in_tree.contains(&link.get_target().to_string()) { - results.push(DependentsEntry( - package.clone(), - link.clone(), - None, - )); - continue; - } - packages_in_tree.push(link.get_target().to_string()); - let dependents = if recurse { - self.get_dependents( - NeedleInput::Single(link.get_target().to_string()), - None, - false, - true, - Some(packages_in_tree.clone()), - )? - } else { - vec![] - }; - results.push(DependentsEntry( - package.clone(), - link.clone(), - Some(dependents), - )); - needles.push(link.get_target().to_string()); + if link.get_source() == needle.as_str() + && (constraint.is_none() + || link.get_constraint().matches(constraint.as_ref().unwrap())) + { + if packages_in_tree.contains(&link.get_target().to_string()) { + results.push(DependentsEntry(package.clone(), link.clone(), None)); + continue; } + packages_in_tree.push(link.get_target().to_string()); + let dependents = if recurse { + self.get_dependents( + NeedleInput::Single(link.get_target().to_string()), + None, + false, + true, + Some(packages_in_tree.clone()), + )? + } else { + vec![] + }; + results.push(DependentsEntry( + package.clone(), + link.clone(), + Some(dependents), + )); + needles.push(link.get_target().to_string()); } } } @@ -187,7 +182,7 @@ impl InstalledRepository { if link.get_target() == needle.as_str() { let matches_constraint = constraint .as_ref() - .map_or(true, |c| link.get_constraint().matches(c) == !invert); + .is_none_or(|c| link.get_constraint().matches(c) != invert); if constraint.is_none() || matches_constraint { if packages_in_tree.contains(&link.get_source().to_string()) { results.push(DependentsEntry(package.clone(), link.clone(), None)); |
