Skip to content

Commit

Permalink
prepare for edition 2024
Browse files Browse the repository at this point in the history
  • Loading branch information
Keruspe committed Aug 19, 2024
1 parent 69b4c2a commit fbb273b
Show file tree
Hide file tree
Showing 12 changed files with 15 additions and 15 deletions.
4 changes: 2 additions & 2 deletions Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -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"]
Expand Down
2 changes: 1 addition & 1 deletion examples/client-certificate.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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") };

Check warning on line 31 in examples/client-certificate.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block

Check warning on line 31 in examples/client-certificate.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block

Check warning on line 31 in examples/client-certificate.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block
}

tracing_subscriber::fmt::init();
Expand Down
2 changes: 1 addition & 1 deletion examples/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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") };

Check warning on line 9 in examples/connection.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block

Check warning on line 9 in examples/connection.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block
}

tracing_subscriber::fmt::init();
Expand Down
2 changes: 1 addition & 1 deletion examples/consumer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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") };

Check warning on line 7 in examples/consumer.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block
}

tracing_subscriber::fmt::init();
Expand Down
2 changes: 1 addition & 1 deletion examples/print-topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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") };

Check warning on line 11 in examples/print-topology.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block

Check warning on line 11 in examples/print-topology.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block
}

tracing_subscriber::fmt::init();
Expand Down
2 changes: 1 addition & 1 deletion examples/publisher_confirms.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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") };

Check warning on line 12 in examples/publisher_confirms.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block

Check warning on line 12 in examples/publisher_confirms.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block

Check warning on line 12 in examples/publisher_confirms.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block

Check warning on line 12 in examples/publisher_confirms.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block
}

tracing_subscriber::fmt::init();
Expand Down
2 changes: 1 addition & 1 deletion examples/pubsub.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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") };

Check warning on line 10 in examples/pubsub.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block

Check warning on line 10 in examples/pubsub.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block
}

tracing_subscriber::fmt::init();
Expand Down
2 changes: 1 addition & 1 deletion examples/reconnect.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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") };

Check warning on line 79 in examples/reconnect.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block

Check warning on line 79 in examples/reconnect.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block

Check warning on line 79 in examples/reconnect.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block
}

tracing_subscriber::fmt::init();
Expand Down
2 changes: 1 addition & 1 deletion examples/restore-topology.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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") };

Check warning on line 7 in examples/restore-topology.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block

Check warning on line 7 in examples/restore-topology.rs

View workflow job for this annotation

GitHub Actions / build_and_test (ubuntu-latest, 1.74.0)

unnecessary `unsafe` block
}

tracing_subscriber::fmt::init();
Expand Down
4 changes: 2 additions & 2 deletions src/buffer.rs
Original file line number Diff line number Diff line change
Expand Up @@ -222,7 +222,7 @@ impl BackToTheBuffer for &mut Buffer {
>(
s: WriteContext<Self>,
reserved: usize,
gen: &Gen,
generator: &Gen,
before: &Before,
) -> Result<WriteContext<Self>, GenError> {
if s.write.available_space() < reserved {
Expand All @@ -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);
Expand Down
4 changes: 2 additions & 2 deletions src/channel.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand All @@ -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);
}
}

Expand Down
2 changes: 1 addition & 1 deletion tests/connection.rs
Original file line number Diff line number Diff line change
Expand Up @@ -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();
Expand Down

0 comments on commit fbb273b

Please sign in to comment.