Skip to content

Commit b0dda04

Browse files
authored
chore: Rust 1.86 Edition 2024 upgrade (#2581)
Signed-off-by: Sreekanth <[email protected]>
1 parent 8c6b7c8 commit b0dda04

Some content is hidden

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

81 files changed

+345
-284
lines changed

Dockerfile

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -22,7 +22,7 @@ RUN chmod +x /bin/entrypoint
2222
####################################################################################################
2323
# Rust binary
2424
####################################################################################################
25-
FROM lukemathwalker/cargo-chef:latest-rust-1.84 AS chef
25+
FROM lukemathwalker/cargo-chef:latest-rust-1.86 AS chef
2626
ARG TARGETPLATFORM
2727
WORKDIR /numaflow
2828
RUN apt-get update && apt-get install -y protobuf-compiler

rust/.rustfmt.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1 +1 @@
1-
edition = "2021"
1+
edition = "2024"

rust/backoff/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "backoff"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[lints]
77
workspace = true

rust/backoff/src/retry.rs

Lines changed: 2 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::task::{Context, Poll};
44
use std::time::Duration;
55

66
use pin_project::pin_project;
7-
use tokio::time::{sleep_until, Instant, Sleep};
7+
use tokio::time::{Instant, Sleep, sleep_until};
88

99
use crate::{Condition, Operation};
1010

@@ -144,8 +144,8 @@ where
144144
#[cfg(test)]
145145
mod tests {
146146
use std::future;
147-
use std::sync::atomic::{AtomicUsize, Ordering};
148147
use std::sync::Arc;
148+
use std::sync::atomic::{AtomicUsize, Ordering};
149149

150150
use super::*;
151151
use crate::strategy::fixed;

rust/extns/numaflow-jetstream/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "numaflow-jetstream"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[dependencies]
77
backoff.workspace = true

rust/extns/numaflow-jetstream/src/lib.rs

Lines changed: 9 additions & 7 deletions
Original file line numberDiff line numberDiff line change
@@ -3,11 +3,11 @@ use std::{collections::HashMap, time::Duration};
33

44
use async_nats::jetstream::{AckKind, Message as JetstreamMessage};
55
use async_nats::{
6+
ConnectOptions,
67
jetstream::consumer::{
7-
pull::{Config, Stream},
88
Consumer, PullConsumer,
9+
pull::{Config, Stream},
910
},
10-
ConnectOptions,
1111
};
1212
use backoff::retry::Retry;
1313
use backoff::strategy::fixed;
@@ -185,7 +185,9 @@ impl JetstreamActor {
185185
tls_config: TlsConfig,
186186
) -> Result<ConnectOptions> {
187187
if tls_config.insecure_skip_verify {
188-
tracing::warn!("'insecureSkipVerify' is set to true, certificate validation will not be performed when connecting to NATS server");
188+
tracing::warn!(
189+
"'insecureSkipVerify' is set to true, certificate validation will not be performed when connecting to NATS server"
190+
);
189191
let tls_client_config = rustls::ClientConfig::builder()
190192
.dangerous()
191193
.with_custom_certificate_verifier(Arc::new(NoVerifier))
@@ -447,7 +449,7 @@ impl MessageProcessingTracker {
447449
let nack_retry_interval =
448450
fixed::Interval::from_millis(ACK_RETRY_INTERVAL).take(ACK_RETRY_ATTEMPTS);
449451

450-
let ack_msg = || async {
452+
let ack_msg = async || {
451453
if let Err(err) = msg.ack().await {
452454
tracing::error!(?err, "Failed to Ack message");
453455
return Err(format!("Acknowledging Jetstream message: {:?}", err));
@@ -457,14 +459,14 @@ impl MessageProcessingTracker {
457459

458460
let ack_with_retry = Retry::retry(ack_retry_interval, ack_msg, |_: &String| true);
459461

460-
let ack_in_progress = || async {
462+
let ack_in_progress = async || {
461463
let ack_result = msg.ack_with(AckKind::Progress).await;
462464
if let Err(e) = ack_result {
463465
tracing::error!(?e, "Failed to send InProgress Ack to Jetstream for message");
464466
}
465467
};
466468

467-
let nack_msg = || async {
469+
let nack_msg = async || {
468470
let ack_result = msg.ack_with(AckKind::Nak(None)).await;
469471
if let Err(e) = ack_result {
470472
tracing::error!(?e, "Failed to send InProgress Ack to Jetstream for message");
@@ -660,8 +662,8 @@ XdvExDsAdjbkBG7ynn9pmMgIJg==
660662
assert!(result.is_ok());
661663
}
662664

663-
use async_nats::jetstream::stream::Config as StreamConfig;
664665
use async_nats::jetstream::Context;
666+
use async_nats::jetstream::stream::Config as StreamConfig;
665667
use tokio::time::Duration;
666668

667669
async fn setup_jetstream() -> (Context, String) {

rust/extns/numaflow-pulsar/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "numaflow-pulsar"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[lints]
77
workspace = true

rust/extns/numaflow-pulsar/src/source.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -4,7 +4,7 @@ use std::{collections::HashMap, time::Duration};
44
use bytes::Bytes;
55
use chrono::{DateTime, Utc};
66
use pulsar::Authentication;
7-
use pulsar::{proto::MessageIdData, Consumer, ConsumerOptions, Pulsar, SubType, TokioExecutor};
7+
use pulsar::{Consumer, ConsumerOptions, Pulsar, SubType, TokioExecutor, proto::MessageIdData};
88
use tokio::time::Instant;
99
use tokio::{
1010
sync::{mpsc, oneshot},

rust/extns/numaflow-sqs/Cargo.toml

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,7 +1,7 @@
11
[package]
22
name = "numaflow-sqs"
33
version = "0.1.0"
4-
edition = "2021"
4+
edition = "2024"
55

66
[lints]
77
workspace = true

rust/extns/numaflow-sqs/src/lib.rs

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -37,7 +37,7 @@ impl From<String> for Error {
3737
#[cfg(test)]
3838
mod tests {
3939
use aws_config::BehaviorVersion;
40-
use aws_smithy_mocks_experimental::{mock, MockResponseInterceptor, RuleMode};
40+
use aws_smithy_mocks_experimental::{MockResponseInterceptor, RuleMode, mock};
4141
use aws_smithy_types::error::ErrorMetadata;
4242

4343
use super::*;
@@ -66,9 +66,11 @@ mod tests {
6666

6767
let converted_error = Error::Sqs(err.into());
6868
assert!(matches!(converted_error, Error::Sqs(_)));
69-
assert!(converted_error
70-
.to_string()
71-
.contains("Failed with SQS error"));
69+
assert!(
70+
converted_error
71+
.to_string()
72+
.contains("Failed with SQS error")
73+
);
7274
}
7375

7476
#[test]

0 commit comments

Comments
 (0)