From fbb273b1697c25cb74ae8593099c5c40e2b6884a Mon Sep 17 00:00:00 2001 From: Marc-Antoine Perennou Date: Mon, 19 Aug 2024 22:10:20 +0200 Subject: [PATCH] prepare for edition 2024 --- Cargo.toml | 4 ++-- examples/client-certificate.rs | 2 +- examples/connection.rs | 2 +- examples/consumer.rs | 2 +- examples/print-topology.rs | 2 +- examples/publisher_confirms.rs | 2 +- examples/pubsub.rs | 2 +- examples/reconnect.rs | 2 +- examples/restore-topology.rs | 2 +- src/buffer.rs | 4 ++-- src/channel.rs | 4 ++-- tests/connection.rs | 2 +- 12 files changed, 15 insertions(+), 15 deletions(-) diff --git a/Cargo.toml b/Cargo.toml index 4725682a..252e06dc 100644 --- a/Cargo.toml +++ b/Cargo.toml @@ -15,9 +15,9 @@ rust-version = "1.74.0" [features] default = ["rustls", "default-runtime"] -default-runtime = ["async-global-executor-trait", "async-reactor-trait"] +default-runtime = ["dep:async-global-executor-trait", "dep:async-reactor-trait"] codegen = ["codegen-internal", "amq-protocol/codegen"] -codegen-internal = ["amq-protocol-codegen", "serde_json"] +codegen-internal = ["dep:amq-protocol-codegen", "dep:serde_json"] native-tls = ["amq-protocol/native-tls"] openssl = ["amq-protocol/openssl"] rustls = ["amq-protocol/rustls"] diff --git a/examples/client-certificate.rs b/examples/client-certificate.rs index af511a47..a3f8b2d3 100644 --- a/examples/client-certificate.rs +++ b/examples/client-certificate.rs @@ -28,7 +28,7 @@ fn get_tls_config() -> OwnedTLSConfig { fn main() { if std::env::var("RUST_LOG").is_err() { - std::env::set_var("RUST_LOG", "info"); + unsafe { std::env::set_var("RUST_LOG", "info") }; } tracing_subscriber::fmt::init(); diff --git a/examples/connection.rs b/examples/connection.rs index 06b0e94e..b286bb18 100644 --- a/examples/connection.rs +++ b/examples/connection.rs @@ -6,7 +6,7 @@ use tracing::info; fn main() { if std::env::var("RUST_LOG").is_err() { - std::env::set_var("RUST_LOG", "info"); + unsafe { std::env::set_var("RUST_LOG", "info") }; } tracing_subscriber::fmt::init(); diff --git a/examples/consumer.rs b/examples/consumer.rs index 8e986974..3941c5c8 100644 --- a/examples/consumer.rs +++ b/examples/consumer.rs @@ -4,7 +4,7 @@ use tracing::info; fn main() { if std::env::var("RUST_LOG").is_err() { - std::env::set_var("RUST_LOG", "info"); + unsafe { std::env::set_var("RUST_LOG", "info") }; } tracing_subscriber::fmt::init(); diff --git a/examples/print-topology.rs b/examples/print-topology.rs index 42fdcff6..fd068961 100644 --- a/examples/print-topology.rs +++ b/examples/print-topology.rs @@ -8,7 +8,7 @@ use tracing::info; fn main() -> Result<()> { if std::env::var("RUST_LOG").is_err() { - std::env::set_var("RUST_LOG", "info"); + unsafe { std::env::set_var("RUST_LOG", "info") }; } tracing_subscriber::fmt::init(); diff --git a/examples/publisher_confirms.rs b/examples/publisher_confirms.rs index 868310a9..f9e0c349 100644 --- a/examples/publisher_confirms.rs +++ b/examples/publisher_confirms.rs @@ -9,7 +9,7 @@ use tracing::info; fn main() { if std::env::var("RUST_LOG").is_err() { - std::env::set_var("RUST_LOG", "info"); + unsafe { std::env::set_var("RUST_LOG", "info") }; } tracing_subscriber::fmt::init(); diff --git a/examples/pubsub.rs b/examples/pubsub.rs index fb835a70..19d61b7a 100644 --- a/examples/pubsub.rs +++ b/examples/pubsub.rs @@ -7,7 +7,7 @@ use tracing::info; fn main() -> Result<()> { if std::env::var("RUST_LOG").is_err() { - std::env::set_var("RUST_LOG", "info"); + unsafe { std::env::set_var("RUST_LOG", "info") }; } tracing_subscriber::fmt::init(); diff --git a/examples/reconnect.rs b/examples/reconnect.rs index 0c056983..fe432bc9 100644 --- a/examples/reconnect.rs +++ b/examples/reconnect.rs @@ -76,7 +76,7 @@ async fn rabbit_stuff(addr: String) -> Result<()> { fn main() -> Result<()> { if std::env::var("RUST_LOG").is_err() { - std::env::set_var("RUST_LOG", "info"); + unsafe { std::env::set_var("RUST_LOG", "info") }; } tracing_subscriber::fmt::init(); diff --git a/examples/restore-topology.rs b/examples/restore-topology.rs index bb399218..cb26705d 100644 --- a/examples/restore-topology.rs +++ b/examples/restore-topology.rs @@ -4,7 +4,7 @@ use tracing::info; fn main() -> Result<()> { if std::env::var("RUST_LOG").is_err() { - std::env::set_var("RUST_LOG", "info"); + unsafe { std::env::set_var("RUST_LOG", "info") }; } tracing_subscriber::fmt::init(); diff --git a/src/buffer.rs b/src/buffer.rs index dc6402df..0d1dda3c 100644 --- a/src/buffer.rs +++ b/src/buffer.rs @@ -222,7 +222,7 @@ impl BackToTheBuffer for &mut Buffer { >( s: WriteContext, reserved: usize, - gen: &Gen, + generator: &Gen, before: &Before, ) -> Result, GenError> { if s.write.available_space() < reserved { @@ -232,7 +232,7 @@ impl BackToTheBuffer for &mut Buffer { } let start = s.write.checkpoint(); s.write.fill(reserved); - gen(s).and_then(|(s, tmp)| { + generator(s).and_then(|(s, tmp)| { let mut end = s.write.checkpoint(); end.backwards = false; s.write.rollback(start); diff --git a/src/channel.rs b/src/channel.rs index 12938411..837ba79b 100644 --- a/src/channel.rs +++ b/src/channel.rs @@ -618,7 +618,7 @@ impl Channel { } } if self.configuration.channel_max() == 0 { - self.configuration.set_channel_max(ChannelId::max_value()); + self.configuration.set_channel_max(ChannelId::MAX); } if frame_max != 0 { @@ -629,7 +629,7 @@ impl Channel { } } if self.configuration.frame_max() == 0 { - self.configuration.set_frame_max(FrameSize::max_value()); + self.configuration.set_frame_max(FrameSize::MAX); } } diff --git a/tests/connection.rs b/tests/connection.rs index 9427ac42..48da9ff4 100644 --- a/tests/connection.rs +++ b/tests/connection.rs @@ -43,7 +43,7 @@ impl ConsumerDelegate for Subscriber { #[test] fn connection() { if std::env::var("RUST_LOG").is_err() { - std::env::set_var("RUST_LOG", "info"); + unsafe { std::env::set_var("RUST_LOG", "info") }; } let _ = tracing_subscriber::fmt::try_init();