Skip to content

Commit 261a38d

Browse files
Saul-STFCsbernauer
andauthored
chore: Bump Rust edition to 2024 (#710)
* 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 * fix(krb5-provision-keytab): disambiguate into_future in CredentialCache Explicitly selecting TryFutureExt::into_future * Refactor: Ignore clippy, reverting loop and update git2 due to advisory * Fix: Update anyhow to address RustSec advisories, reverting p12 to 2021 and ignore cargo warning --------- Co-authored-by: Sebastian Bernauer <sebastian.bernauer@stackable.de>
1 parent ec4c5d3 commit 261a38d

8 files changed

Lines changed: 32 additions & 138 deletions

File tree

Cargo.lock

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

Cargo.nix

Lines changed: 15 additions & 90 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/krb5-provision-keytab/src/credential_cache.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -94,10 +94,9 @@ impl CredentialCache {
9494
.expect("key was just confirmed to exist in cache")))
9595
} else {
9696
tracing::info!("credential not found in cache, generating...");
97-
match mk_value(Ctx {
97+
match TryFutureExt::into_future(mk_value(Ctx {
9898
cache_ref: self.cache_ref.clone(),
99-
})
100-
.into_future()
99+
}))
101100
.await
102101
{
103102
Ok(value) => {

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: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -121,6 +121,7 @@ pub fn error_full_message(err: &dyn std::error::Error) -> String {
121121
}
122122

123123
/// Propagates `Ok(true)` and `Err(_)` from `stream`, otherwise returns `Ok(false)`.
124+
#[allow(tail_expr_drop_order)]
124125
pub async fn trystream_any<S: Stream<Item = Result<bool, E>>, E>(stream: S) -> Result<bool, E> {
125126
pin_mut!(stream);
126127
while let Some(value) = stream.next().await {

rust/p12/src/lib.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -635,7 +635,7 @@ fn pbepkcs12sha1core(d: &[u8], i: &[u8], a: &mut Vec<u8>, iterations: u64) -> Ve
635635
a.append(&mut ai.clone());
636636
ai
637637
}
638-
638+
#[allow(clippy::manual_div_ceil)] // This is a fork, ignoring errors
639639
#[allow(clippy::many_single_char_names)]
640640
fn pbepkcs12sha1(pass: &[u8], salt: &[u8], iterations: u64, id: u8, size: u64) -> Vec<u8> {
641641
const U: u64 = 160 / 8;

0 commit comments

Comments
 (0)