Skip to content

Commit ea1e686

Browse files
committed
chore: bump Rust edition to 2024 and update dependencies + clippy refactors
Upgrade workspace and crates to Rust 2024 edition and apply tool-driven fixes: - Bump Rust edition from 2021 to 2024 across workspace crates (Cargo.toml, Cargo.nix) - Update `rustls-webpki` dependency to 0.103.13 - Apply `cargo fix --edition` changes - Add `use<>` lifetime capture in `impl Trait` return types for iterators - Apply Clippy suggestions and minor refactors - Simplify iterator-returning functions with correct lifetime capture syntax - Refactor `trystream_any` to fix warning
1 parent e5b7479 commit ea1e686

7 files changed

Lines changed: 25 additions & 20 deletions

File tree

Cargo.lock

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

Cargo.nix

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

Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -7,7 +7,7 @@ resolver = "2"
77
version = "0.0.0-dev"
88
authors = ["Stackable GmbH <info@stackable.tech>"]
99
license = "OSL-3.0"
10-
edition = "2021"
10+
edition = "2024"
1111
repository = "https://github.com/stackabletech/secret-operator"
1212

1313
[workspace.dependencies]

rust/operator-binary/src/crd/secret_class/v1alpha1_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -20,7 +20,7 @@ impl SecretClassBackend {
2020
pub fn refers_to_config_map(
2121
&self,
2222
config_map: &PartialObjectMeta<ConfigMap>,
23-
) -> impl Iterator<Item = SearchNamespaceMatchCondition> {
23+
) -> impl Iterator<Item = SearchNamespaceMatchCondition> + use<> {
2424
let cm_namespace = config_map.metadata.namespace.as_deref();
2525
match self {
2626
Self::K8sSearch(backend) => {
@@ -40,7 +40,7 @@ impl SecretClassBackend {
4040
pub fn refers_to_secret(
4141
&self,
4242
secret: &PartialObjectMeta<Secret>,
43-
) -> impl Iterator<Item = SearchNamespaceMatchCondition> {
43+
) -> impl Iterator<Item = SearchNamespaceMatchCondition> + use<> {
4444
match self {
4545
Self::AutoTls(backend) => {
4646
(backend.ca.secret == *secret).then_some(SearchNamespaceMatchCondition::True)

rust/operator-binary/src/crd/secret_class/v1alpha2_impl.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -26,7 +26,7 @@ impl SecretClassBackend {
2626
pub fn refers_to_config_map(
2727
&self,
2828
config_map: &PartialObjectMeta<ConfigMap>,
29-
) -> impl Iterator<Item = SearchNamespaceMatchCondition> {
29+
) -> impl Iterator<Item = SearchNamespaceMatchCondition> + use<> {
3030
let cm_namespace = config_map.metadata.namespace.as_deref();
3131
match self {
3232
Self::K8sSearch(backend) => {
@@ -46,7 +46,7 @@ impl SecretClassBackend {
4646
pub fn refers_to_secret(
4747
&self,
4848
secret: &PartialObjectMeta<Secret>,
49-
) -> impl Iterator<Item = SearchNamespaceMatchCondition> {
49+
) -> impl Iterator<Item = SearchNamespaceMatchCondition> + use<> {
5050
match self {
5151
Self::AutoTls(backend) => {
5252
(backend.ca.secret == *secret).then_some(SearchNamespaceMatchCondition::True)

rust/operator-binary/src/utils.rs

Lines changed: 9 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -123,14 +123,19 @@ pub fn error_full_message(err: &dyn std::error::Error) -> String {
123123
/// Propagates `Ok(true)` and `Err(_)` from `stream`, otherwise returns `Ok(false)`.
124124
pub async fn trystream_any<S: Stream<Item = Result<bool, E>>, E>(stream: S) -> Result<bool, E> {
125125
pin_mut!(stream);
126-
while let Some(value) = stream.next().await {
127-
if let Ok(true) | Err(_) = value {
128-
return value;
126+
loop {
127+
let next_item = stream.next().await;
128+
match next_item {
129+
Some(value) => {
130+
if let Ok(true) | Err(_) = value {
131+
return value;
132+
}
133+
}
134+
None => break,
129135
}
130136
}
131137
Ok(false)
132138
}
133-
134139
/// Concatenate chunks of bytes, short-circuiting on [`Err`].
135140
///
136141
/// This is a byte-oriented equivalent to [`Iterator::collect::<Result<String, _>>`](`Iterator::collect`).

rust/p12/Cargo.toml

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -2,14 +2,14 @@
22
name = "p12"
33
version.workspace = true
44
authors = ["hjiayz <hjiayz@gmail.com>", "Marc-Antoine Perennou <Marc-Antoine@Perennou.com>"]
5-
edition = "2021"
5+
edition = "2024"
66
keywords = ["pkcs12", "pkcs"]
77
description = "pure rust pkcs12 tool (Stackable fork)"
88
homepage = "https://github.com/hjiayz/p12"
99
repository = "https://github.com/hjiayz/p12"
1010
readme = "README.md"
1111
license = "MIT OR Apache-2.0"
12-
rust-version = "1.56.0"
12+
rust-version = "1.85.0"
1313

1414
# Dependencies are tracked inline for now, to minimize divergence from upstream
1515

0 commit comments

Comments
 (0)