Skip to content

Commit 4e66404

Browse files
committed
stable rust, update deps, format
1 parent 683a6ce commit 4e66404

23 files changed

Lines changed: 863 additions & 747 deletions

Cargo.lock

Lines changed: 655 additions & 556 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

Cargo.toml

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -21,20 +21,21 @@ license = { workspace = true }
2121
publish = { workspace = true }
2222

2323
[dependencies]
24-
actix-web = { version = "4.11.0", features = ["http2"] }
25-
base16ct = { version = "0.2.0", features = ["std"] }
24+
actix-web = { version = "4.12.1", features = ["http2"] }
25+
base16ct = { version = "0.3.0", features = ["alloc"] }
2626
clap = { version = "4.5.41", features = ["derive", "env"] }
2727
documented = "0.9.2"
2828
env_logger = "0.11.8"
2929
maven = { version = "*", path = "maven" }
30-
moka = { version = "=0.12.11", features = ["future"] }
30+
moka = { version = "0.12.12", features = ["future"] }
3131
prometheus-client = "0.24.0"
32-
reqwest = { version = "0.12.22", default-features = false, features = ["charset", "http2", "system-proxy", "json", "rustls-tls"] }
32+
reqwest = { version = "0.13.1", default-features = false, features = ["charset", "http2", "system-proxy", "json", "rustls-no-provider"] }
33+
rustls = { version = "0.23.35", default-features = false, features = ["ring", "std", "tls12", "logging"] }
3334
semver = "1.0.26"
3435
serde = { workspace = true }
3536
serde_json = { workspace = true }
3637
serde_variant = "0.1.3"
37-
sha2 = "0.11.0-rc.0"
38+
sha2 = "0.11.0-rc.3"
3839
thiserror = "2.0.12"
3940
tokio = { version = "1.46.1", features = ["macros", "rt-multi-thread"] }
4041
url = { version = "2.5.4", features = ["serde"] }

deny.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -14,7 +14,7 @@ ignore = []
1414
# See https://spdx.org/licenses/ for list of possible licenses
1515
# [possible values: any SPDX 3.11 short identifier (+ optional exception)].
1616
allow = [ # All licenses allowed here MUST be GPLv3 compatible (https://www.gnu.org/licenses/license-list.en.html)
17-
"GPL-3.0",
17+
"GPL-3.0-or-later",
1818
"MIT",
1919
"Apache-2.0",
2020
"BSD-3-Clause",
@@ -53,5 +53,5 @@ allow-registry = [
5353
"https://github.com/rust-lang/crates.io-index"
5454
]
5555
allow-git = [
56-
"https://github.com/whamcloud/client_rust.git"
56+
# "https://github.com/whamcloud/client_rust.git"
5757
]

flake.lock

Lines changed: 12 additions & 12 deletions
Some generated files are not rendered by default. Learn more about customizing how changed files appear on GitHub.

maven/src/parsing/gradle.rs

Lines changed: 13 additions & 13 deletions
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ type Attributes<'a> = HashMap<Cow<'a, str>, AttributeValue<'a>>;
1313
pub enum AttributeValue<'a> {
1414
String(#[serde_as(as = "BorrowCow")] Cow<'a, str>),
1515
Boolean(bool),
16-
Integer(i64)
16+
Integer(i64),
1717
}
1818

1919
#[derive(Debug, Deserialize)]
@@ -22,7 +22,7 @@ pub struct GradleModuleMetadata<'a> {
2222
#[serde(borrow)]
2323
pub component: Option<Component<'a>>,
2424
#[serde(borrow, default)]
25-
pub variants: Vec<Variant<'a>>
25+
pub variants: Vec<Variant<'a>>,
2626
}
2727

2828
#[serde_as]
@@ -38,7 +38,7 @@ pub struct Component<'a> {
3838
#[serde_as(as = "Option<BorrowCow>")]
3939
pub url: Option<Cow<'a, str>>,
4040
#[serde(borrow, default)]
41-
pub attributes: Attributes<'a>
41+
pub attributes: Attributes<'a>,
4242
}
4343

4444
#[serde_as]
@@ -57,7 +57,7 @@ pub struct Variant<'a> {
5757
#[serde(borrow, default)]
5858
pub files: Vec<File<'a>>,
5959
#[serde(borrow, default)]
60-
pub capabilities: Vec<Capability<'a>>
60+
pub capabilities: Vec<Capability<'a>>,
6161
}
6262

6363
#[serde_as]
@@ -69,7 +69,7 @@ pub struct Capability<'a> {
6969
#[serde_as(as = "BorrowCow")]
7070
pub name: Cow<'a, str>,
7171
#[serde_as(as = "BorrowCow")]
72-
pub version: Cow<'a, str>
72+
pub version: Cow<'a, str>,
7373
}
7474

7575
#[serde_as]
@@ -94,7 +94,7 @@ pub struct Dependency<'a> {
9494
#[serde(default)]
9595
pub endorse_strict_versions: bool,
9696
#[serde(borrow)]
97-
pub third_party_compatibility: Option<ThirdPartyCompatibility<'a>>
97+
pub third_party_compatibility: Option<ThirdPartyCompatibility<'a>>,
9898
}
9999

100100
#[serde_as]
@@ -109,7 +109,7 @@ pub struct DependencyConstraints<'a> {
109109
pub version: Option<VersionConstraint<'a>>,
110110
#[serde_as(as = "HashMap<BorrowCow, _>")]
111111
#[serde(borrow, default)]
112-
pub attributes: Attributes<'a>
112+
pub attributes: Attributes<'a>,
113113
}
114114

115115
#[serde_as]
@@ -128,7 +128,7 @@ pub struct File<'a> {
128128
#[serde_as(as = "BorrowCow")]
129129
pub sha512: Cow<'a, str>,
130130
#[serde_as(as = "BorrowCow")]
131-
pub md5: Cow<'a, str>
131+
pub md5: Cow<'a, str>,
132132
}
133133

134134
#[serde_as]
@@ -143,7 +143,7 @@ pub struct VersionConstraint<'a> {
143143
pub strictly: Option<Cow<'a, str>>,
144144
#[serde(default)]
145145
#[serde_as(as = "Vec<BorrowCow>")]
146-
pub rejects: Vec<Cow<'a, str>>
146+
pub rejects: Vec<Cow<'a, str>>,
147147
}
148148

149149
#[serde_as]
@@ -153,14 +153,14 @@ pub struct Excludes<'a> {
153153
#[serde_as(as = "BorrowCow")]
154154
pub group: Cow<'a, str>,
155155
#[serde_as(as = "BorrowCow")]
156-
pub module: Cow<'a, str>
156+
pub module: Cow<'a, str>,
157157
}
158158

159159
#[derive(Debug, Deserialize)]
160160
#[serde(rename_all = "camelCase")]
161161
pub struct ThirdPartyCompatibility<'a> {
162162
#[serde(borrow)]
163-
pub artifact_selector: ArtifactSelector<'a>
163+
pub artifact_selector: ArtifactSelector<'a>,
164164
}
165165

166166
#[serde_as]
@@ -174,7 +174,7 @@ pub struct ArtifactSelector<'a> {
174174
#[serde_as(as = "BorrowCow")]
175175
pub extension: Cow<'a, str>,
176176
#[serde_as(as = "BorrowCow")]
177-
pub classifier: Cow<'a, str>
177+
pub classifier: Cow<'a, str>,
178178
}
179179

180180
impl<'a> GradleModuleMetadata<'a> {
@@ -189,7 +189,7 @@ mod tests {
189189

190190
const EXAMPLES: &[&str] = &[
191191
include_str!("../../tests/module/valid_metadata_1.module"),
192-
include_str!("../../tests/module/valid_metadata_2.module")
192+
include_str!("../../tests/module/valid_metadata_2.module"),
193193
];
194194

195195
#[test]

maven/src/parsing/maven.rs

Lines changed: 7 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -17,7 +17,7 @@ pub struct MavenArtifactMetadata<'a> {
1717
pub artifact_id: Cow<'a, str>,
1818
/// Versioning information about this artifact
1919
#[serde(borrow)]
20-
pub versioning: ArtifactVersioning<'a>
20+
pub versioning: ArtifactVersioning<'a>,
2121
}
2222

2323
#[derive(Debug, Deserialize)]
@@ -35,14 +35,14 @@ pub struct ArtifactVersioning<'a> {
3535
pub versions: Vec<Cow<'a, str>>,
3636
/// When the metadata was last updated
3737
#[serde(deserialize_with = "crate::serde::deserialize_maven_timestamp")]
38-
pub last_updated: DateTime<Utc>
38+
pub last_updated: DateTime<Utc>,
3939
}
4040

4141
impl<'a> MavenArtifactMetadata<'a> {
4242
pub fn get_metadata_url(
4343
repository_url: impl AsRef<str>,
4444
group_id: impl Into<Cow<'a, str>>,
45-
artifact_id: impl Into<Cow<'a, str>>
45+
artifact_id: impl Into<Cow<'a, str>>,
4646
) -> String {
4747
let repository_url = repository_url.as_ref();
4848

@@ -59,7 +59,7 @@ impl<'a> MavenArtifactMetadata<'a> {
5959
group_id
6060
.into()
6161
.chars()
62-
.map(|c| if c == '.' { '/' } else { c })
62+
.map(|c| if c == '.' { '/' } else { c }),
6363
);
6464
url.push('/');
6565

@@ -84,14 +84,14 @@ mod tests {
8484
"https://repo.polyfrost.org/releases/",
8585
"cc.polyfrost",
8686
"oneconfig-1.8.9-forge",
87-
"https://repo.polyfrost.org/releases/cc/polyfrost/oneconfig-1.8.9-forge/maven-metadata.xml"
87+
"https://repo.polyfrost.org/releases/cc/polyfrost/oneconfig-1.8.9-forge/maven-metadata.xml",
8888
),
8989
(
9090
"https://maven.aliucord.com/snapshots",
9191
"com.aliucord",
9292
"gradle",
93-
"https://maven.aliucord.com/snapshots/com/aliucord/gradle/maven-metadata.xml"
94-
)
93+
"https://maven.aliucord.com/snapshots/com/aliucord/gradle/maven-metadata.xml",
94+
),
9595
];
9696

9797
#[test]

maven/src/serde.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -8,7 +8,7 @@ use serde::{Deserialize, Deserializer};
88
use serde_with::{BorrowCow, serde_as};
99

1010
pub(crate) fn deserialize_maven_timestamp<'de, D: Deserializer<'de>>(
11-
deserializer: D
11+
deserializer: D,
1212
) -> Result<DateTime<Utc>, D::Error> {
1313
let s = Cow::<'de, str>::deserialize(deserializer)?;
1414

@@ -18,7 +18,7 @@ pub(crate) fn deserialize_maven_timestamp<'de, D: Deserializer<'de>>(
1818
}
1919

2020
pub(crate) fn derserialize_version_list<'de, D: Deserializer<'de>>(
21-
deserializer: D
21+
deserializer: D,
2222
) -> Result<Vec<Cow<'de, str>>, D::Error> {
2323
/// Represents
2424
/// ```xml
@@ -34,7 +34,7 @@ pub(crate) fn derserialize_version_list<'de, D: Deserializer<'de>>(
3434
struct VersionList<'a> {
3535
#[serde(borrow, default)]
3636
#[serde_as(as = "Vec<BorrowCow>")]
37-
version: Vec<Cow<'a, str>>
37+
version: Vec<Cow<'a, str>>,
3838
}
3939

4040
Ok(VersionList::deserialize(deserializer)?.version)

maven/src/types.rs

Lines changed: 21 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -7,14 +7,14 @@ pub struct ArtifactCoordinate<'a> {
77
pub(crate) version: Cow<'a, str>,
88
pub(crate) base_version: Cow<'a, str>,
99
pub(crate) classifier: Cow<'a, str>,
10-
pub(crate) extension: Cow<'a, str>
10+
pub(crate) extension: Cow<'a, str>,
1111
}
1212

1313
impl<'a> ArtifactCoordinate<'a> {
1414
pub fn new(
1515
group_id: impl Into<Cow<'a, str>>,
1616
artifact_id: impl Into<Cow<'a, str>>,
17-
version: impl Into<Cow<'a, str>>
17+
version: impl Into<Cow<'a, str>>,
1818
) -> Self {
1919
let version = version.into();
2020
ArtifactCoordinate {
@@ -23,21 +23,33 @@ impl<'a> ArtifactCoordinate<'a> {
2323
base_version: version.clone(),
2424
version,
2525
classifier: "".into(),
26-
extension: "jar".into()
26+
extension: "jar".into(),
2727
}
2828
}
2929

30-
pub fn group_id(&self) -> &str { &self.group_id }
30+
pub fn group_id(&self) -> &str {
31+
&self.group_id
32+
}
3133

32-
pub fn artifact_id(&self) -> &str { &self.artifact_id }
34+
pub fn artifact_id(&self) -> &str {
35+
&self.artifact_id
36+
}
3337

34-
pub fn version(&self) -> &str { &self.version }
38+
pub fn version(&self) -> &str {
39+
&self.version
40+
}
3541

36-
pub fn base_version(&self) -> &str { &self.base_version }
42+
pub fn base_version(&self) -> &str {
43+
&self.base_version
44+
}
3745

38-
pub fn classifier(&self) -> &str { &self.classifier }
46+
pub fn classifier(&self) -> &str {
47+
&self.classifier
48+
}
3949

40-
pub fn extension(&self) -> &str { &self.extension }
50+
pub fn extension(&self) -> &str {
51+
&self.extension
52+
}
4153

4254
pub fn with_base_version(mut self, base_version: impl Into<Cow<'a, str>>) -> Self {
4355
self.base_version = base_version.into();

0 commit comments

Comments
 (0)