aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-semver/src/intervals.rs
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-05-17 15:08:03 +0900
committernsfisis <nsfisis@gmail.com>2026-05-17 15:08:03 +0900
commit748e741f740ac46ec40e42679aba3b07927709c0 (patch)
tree31f01831b11613631ba68da047abf1a9aa43f1b0 /crates/shirabe-semver/src/intervals.rs
parent79bcd3a9ce71954ce7b257e5f3ca1c147c0d974a (diff)
downloadphp-shirabe-748e741f740ac46ec40e42679aba3b07927709c0.tar.gz
php-shirabe-748e741f740ac46ec40e42679aba3b07927709c0.tar.zst
php-shirabe-748e741f740ac46ec40e42679aba3b07927709c0.zip
chore: cargo clippy --fix
Diffstat (limited to 'crates/shirabe-semver/src/intervals.rs')
-rw-r--r--crates/shirabe-semver/src/intervals.rs24
1 files changed, 4 insertions, 20 deletions
diff --git a/crates/shirabe-semver/src/intervals.rs b/crates/shirabe-semver/src/intervals.rs
index be7466e..898cab3 100644
--- a/crates/shirabe-semver/src/intervals.rs
+++ b/crates/shirabe-semver/src/intervals.rs
@@ -393,11 +393,7 @@ impl Intervals {
if branches.exclude {
// disjunctive constraint, so only exclude what's excluded in all constraints
// !=a,!=b || !=b,!=c => !=b
- branches.names = branches
- .names
- .into_iter()
- .filter(|n| b.names.contains(n))
- .collect();
+ branches.names.retain(|n| b.names.contains(n));
} else {
// disjunctive constraint so exclude all names which are not explicitly
// included in the alternative
@@ -414,11 +410,7 @@ impl Intervals {
// disjunctive constraint so exclude all names which are not explicitly
// included in the alternative
// !=a,!=b || (==b || ==c) => !=a
- branches.names = branches
- .names
- .into_iter()
- .filter(|n| !b.names.contains(n))
- .collect();
+ branches.names.retain(|n| !b.names.contains(n));
} else {
// disjunctive constraint, so just add all the other branches
// (==a || ==b) || ==c => ==a || ==b || ==c
@@ -438,11 +430,7 @@ impl Intervals {
} else {
// conjunctive, so only keep included names which are not excluded
// (==a||==c) && !=a,!=b => ==c
- branches.names = branches
- .names
- .into_iter()
- .filter(|n| !b.names.contains(n))
- .collect();
+ branches.names.retain(|n| !b.names.contains(n));
}
} else {
if branches.exclude {
@@ -457,11 +445,7 @@ impl Intervals {
} else {
// conjunctive, so only keep names that are included in both
// (==a||==b) && (==a||==c) => ==a
- branches.names = branches
- .names
- .into_iter()
- .filter(|n| b.names.contains(n))
- .collect();
+ branches.names.retain(|n| b.names.contains(n));
}
}
}