Skip to content

Commit efad1b5

Browse files
committed
fix(rust): update edition from 2021 to 2024
1 parent a375df4 commit efad1b5

69 files changed

Lines changed: 280 additions & 288 deletions

Some content is hidden

Large Commits have some content hidden by default. Use the searchbox below for content that may be hidden.

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -5,7 +5,7 @@ members = ["crates/syncpack-specifier"]
55
name = "syncpack"
66
version = "14.3.1"
77
authors = ["Jamie Mason <jamie@foldleft.io>"]
8-
edition = "2021"
8+
edition = "2024"
99
homepage = "https://syncpack.dev"
1010
repository = "https://github.com/JamieMason/syncpack/tree/rust/main"
1111
description = "Consistent dependency versions in large JavaScript Monorepos"

crates/syncpack-specifier/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
name = "syncpack-specifier"
33
version = "14.3.1"
44
authors = ["Jamie Mason <jamie@foldleft.io>"]
5-
edition = "2021"
5+
edition = "2024"
66
description = "npm version specifier parser and comparator"
77
license = "MIT"
88

crates/syncpack-specifier/benches/specifier_parsing.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use {
2-
criterion::{criterion_group, criterion_main, BenchmarkId, Criterion},
2+
criterion::{BenchmarkId, Criterion, criterion_group, criterion_main},
33
std::{hint::black_box, time::Duration},
44
syncpack_specifier::Specifier,
55
};

crates/syncpack-specifier/src/eq_hash_test.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -22,6 +22,7 @@ fn specifier_neq_when_raw_differs() {
2222
}
2323

2424
#[test]
25+
#[allow(clippy::mutable_key_type)]
2526
fn specifier_hash_consistent_with_eq() {
2627
let a = Specifier::new("^1.2.3");
2728
let b = Specifier::new("^1.2.3");
@@ -31,6 +32,7 @@ fn specifier_hash_consistent_with_eq() {
3132
}
3233

3334
#[test]
35+
#[allow(clippy::mutable_key_type)]
3436
fn specifier_in_hashset() {
3537
let mut set: HashSet<Rc<Specifier>> = HashSet::new();
3638
set.insert(Specifier::new("1.0.0"));
@@ -40,6 +42,7 @@ fn specifier_in_hashset() {
4042
}
4143

4244
#[test]
45+
#[allow(clippy::mutable_key_type)]
4346
fn specifier_none_hashes() {
4447
let a = Specifier::new("");
4548
let b = Specifier::new("");

crates/syncpack-specifier/src/git.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use {
2-
crate::{semver_range::SemverRange, Specifier},
2+
crate::{Specifier, semver_range::SemverRange},
33
std::rc::Rc,
44
};
55

crates/syncpack-specifier/src/is_eligible_update_for_test.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,4 +1,4 @@
1-
use crate::{update_target::UpdateTarget, Specifier};
1+
use crate::{Specifier, update_target::UpdateTarget};
22

33
#[test]
44
fn for_latest() {

crates/syncpack-specifier/src/latest.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use {
2-
crate::{semver_range::SemverRange, Specifier, HUGE},
2+
crate::{HUGE, Specifier, semver_range::SemverRange},
33
std::{cell::OnceCell, rc::Rc},
44
};
55

crates/syncpack-specifier/src/lib.rs

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -800,10 +800,11 @@ impl Specifier {
800800
pub fn has_same_version_number_as(&self, other: &Self) -> bool {
801801
// Special case: unresolved workspace protocols with identical raw strings
802802
// should be considered equal (e.g., "workspace:*" == "workspace:*")
803-
if let (Self::WorkspaceProtocol(left), Self::WorkspaceProtocol(right)) = (self, other) {
804-
if left.needs_resolution() && right.needs_resolution() {
805-
return left.raw == right.raw;
806-
}
803+
if let (Self::WorkspaceProtocol(left), Self::WorkspaceProtocol(right)) = (self, other)
804+
&& left.needs_resolution()
805+
&& right.needs_resolution()
806+
{
807+
return left.raw == right.raw;
807808
}
808809

809810
if !self.has_comparable_version() || !other.has_comparable_version() {

crates/syncpack-specifier/src/major.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use {
2-
crate::{Specifier, HUGE},
2+
crate::{HUGE, Specifier},
33
std::{cell::OnceCell, rc::Rc},
44
};
55

crates/syncpack-specifier/src/minor.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
use {
2-
crate::{Specifier, HUGE},
2+
crate::{HUGE, Specifier},
33
std::{cell::OnceCell, rc::Rc},
44
};
55

0 commit comments

Comments
 (0)