From 9a0f46710acb5ff6335e112967bca401993ffe94 Mon Sep 17 00:00:00 2001 From: Zeeshan Ali Khan Date: Sun, 11 Feb 2024 00:28:09 +0100 Subject: [PATCH] =?UTF-8?q?=F0=9F=9A=A8=20tests:=20Fix=20clippy=20warnings?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- tests/fdo.rs | 2 +- tests/greet.rs | 2 +- tests/monitor.rs | 9 ++++----- tests/multiple_conns.rs | 2 +- 4 files changed, 7 insertions(+), 8 deletions(-) diff --git a/tests/fdo.rs b/tests/fdo.rs index 0c0d2f0..c10ce42 100644 --- a/tests/fdo.rs +++ b/tests/fdo.rs @@ -34,7 +34,7 @@ async fn name_ownership_changes() { } // TCP socket - let address = format!("tcp:host=127.0.0.1,port=4242"); + let address = "tcp:host=127.0.0.1,port=4242".to_string(); name_ownership_changes_(&address, AuthMechanism::Cookie).await; name_ownership_changes_(&address, AuthMechanism::Anonymous).await; } diff --git a/tests/greet.rs b/tests/greet.rs index 0cf4974..1c7bb2a 100644 --- a/tests/greet.rs +++ b/tests/greet.rs @@ -37,7 +37,7 @@ async fn greet() { } // TCP socket - let address = format!("tcp:host=127.0.0.1,port=4248"); + let address = "tcp:host=127.0.0.1,port=4248".to_string(); greet_(&address, AuthMechanism::Cookie).await; greet_(&address, AuthMechanism::Anonymous).await; } diff --git a/tests/monitor.rs b/tests/monitor.rs index 45f9ad0..1b824a8 100644 --- a/tests/monitor.rs +++ b/tests/monitor.rs @@ -16,7 +16,7 @@ use zbus::{ async fn become_monitor() { busd::tracing_subscriber::init(); - let address = format!("tcp:host=127.0.0.1,port=4242"); + let address = "tcp:host=127.0.0.1,port=4242".to_string(); let mut bus = Bus::for_address(Some(&address), AuthMechanism::Anonymous) .await .unwrap(); @@ -57,10 +57,9 @@ async fn become_monitor_client(address: &str, tx: Sender<()>) -> anyhow::Result< // Signals for the monitor loosing its unique name. let signal = loop { let msg = msg_stream.try_next().await?.unwrap(); - match NameOwnerChanged::from_message(msg) { - Some(signal) => break signal, - // Ignore other messages (e.g `BecomeMonitor` method & reply) - None => (), + // Ignore other messages (e.g `BecomeMonitor` method & reply) + if let Some(signal) = NameOwnerChanged::from_message(msg) { + break signal; } }; let args = signal.args()?; diff --git a/tests/multiple_conns.rs b/tests/multiple_conns.rs index dba6d5e..9aba4ef 100644 --- a/tests/multiple_conns.rs +++ b/tests/multiple_conns.rs @@ -28,7 +28,7 @@ async fn multi_conenct() { } // TCP socket - let address = format!("tcp:host=127.0.0.1,port=4246"); + let address = "tcp:host=127.0.0.1,port=4246".to_string(); multi_conenct_(&address, AuthMechanism::Cookie).await; multi_conenct_(&address, AuthMechanism::Anonymous).await; }