aboutsummaryrefslogtreecommitdiffhomepage
path: root/crates/shirabe-semver/src
diff options
context:
space:
mode:
authornsfisis <nsfisis@gmail.com>2026-07-25 16:16:33 +0900
committernsfisis <nsfisis@gmail.com>2026-07-25 16:17:10 +0900
commit432472808051cb4f1bb9517b858dbc810aaa5a63 (patch)
tree4c58b97942853ea2c3f58368203fa93187746cf8 /crates/shirabe-semver/src
parentd4608662f28b9a5135986b1702afe3199957eabe (diff)
downloadphp-shirabe-432472808051cb4f1bb9517b858dbc810aaa5a63.tar.gz
php-shirabe-432472808051cb4f1bb9517b858dbc810aaa5a63.tar.zst
php-shirabe-432472808051cb4f1bb9517b858dbc810aaa5a63.zip
refactor: replace redundant clones with moves
Co-Authored-By: Claude Opus 5 <noreply@anthropic.com>
Diffstat (limited to 'crates/shirabe-semver/src')
-rw-r--r--crates/shirabe-semver/src/interval.rs5
-rw-r--r--crates/shirabe-semver/src/intervals.rs19
2 files changed, 9 insertions, 15 deletions
diff --git a/crates/shirabe-semver/src/interval.rs b/crates/shirabe-semver/src/interval.rs
index 7f275149..97461790 100644
--- a/crates/shirabe-semver/src/interval.rs
+++ b/crates/shirabe-semver/src/interval.rs
@@ -36,10 +36,7 @@ impl Interval {
}
pub fn any() -> Self {
- Self::new(
- Self::from_zero().clone(),
- Self::until_positive_infinity().clone(),
- )
+ Self::new(Self::from_zero(), Self::until_positive_infinity())
}
pub fn any_dev() -> DevConstraintSet {
diff --git a/crates/shirabe-semver/src/intervals.rs b/crates/shirabe-semver/src/intervals.rs
index 862b3add..0f9db7cd 100644
--- a/crates/shirabe-semver/src/intervals.rs
+++ b/crates/shirabe-semver/src/intervals.rs
@@ -315,8 +315,8 @@ impl Intervals {
if constraint.is_match_all() {
return Ok(IntervalCollection {
numeric: vec![Interval::new(
- Interval::from_zero().clone(),
- Interval::until_positive_infinity().clone(),
+ Interval::from_zero(),
+ Interval::until_positive_infinity(),
)],
branches: Interval::any_dev(),
});
@@ -515,8 +515,8 @@ impl Intervals {
// really defined for branches
if op == "!=" {
intervals.push(Interval::new(
- Interval::from_zero().clone(),
- Interval::until_positive_infinity().clone(),
+ Interval::from_zero(),
+ Interval::until_positive_infinity(),
));
branches = DevConstraintSet {
names: vec![constraint.get_version().to_string()],
@@ -537,7 +537,7 @@ impl Intervals {
return Ok(IntervalCollection {
numeric: vec![Interval::new(
constraint.clone(),
- Interval::until_positive_infinity().clone(),
+ Interval::until_positive_infinity(),
)],
branches: Interval::no_dev(),
});
@@ -545,10 +545,7 @@ impl Intervals {
if op.starts_with('<') {
// < & <=
return Ok(IntervalCollection {
- numeric: vec![Interval::new(
- Interval::from_zero().clone(),
- constraint.clone(),
- )],
+ numeric: vec![Interval::new(Interval::from_zero(), constraint.clone())],
branches: Interval::no_dev(),
});
}
@@ -557,7 +554,7 @@ impl Intervals {
return Ok(IntervalCollection {
numeric: vec![
Interval::new(
- Interval::from_zero().clone(),
+ Interval::from_zero(),
SimpleConstraint::new(
"<".to_string(),
constraint.get_version().to_string(),
@@ -570,7 +567,7 @@ impl Intervals {
constraint.get_version().to_string(),
None,
),
- Interval::until_positive_infinity().clone(),
+ Interval::until_positive_infinity(),
),
],
branches: Interval::any_dev(),