Skip to content

Commit 5782670

Browse files
author
Derek
committed
fix: clippy single_match_else and match_same_arms
1 parent 86ec07b commit 5782670

2 files changed

Lines changed: 14 additions & 27 deletions

File tree

tests/metrics_integration.rs

Lines changed: 2 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -526,9 +526,8 @@ async fn test_15_shutdown_stops_accepting() {
526526
// Verify TCP connect is refused after shutdown
527527
let connect = timeout(Duration::from_millis(500), TcpStream::connect(&addr)).await;
528528
let refused = match connect {
529-
Ok(Ok(_)) => false, // Connected — not shut down
530-
Ok(Err(_)) => true, // Connection refused — correct
531-
Err(_) => true, // Timed out — also acceptable
529+
Ok(Ok(_)) => false, // Connected — not shut down
530+
Ok(Err(_)) | Err(_) => true, // Connection refused or timed out
532531
};
533532
assert!(refused, "server should refuse connections after shutdown");
534533
}

tests/vector_compat_integration.rs

Lines changed: 12 additions & 24 deletions
Original file line numberDiff line numberDiff line change
@@ -169,12 +169,9 @@ fn assert_no_vector_errors(stderr: &str) {
169169
/// VectorCompatService → message channel → recv().
170170
#[tokio::test]
171171
async fn test_vector_grpc_sink_to_transport() {
172-
let vector_bin = match vector_binary_path() {
173-
Some(path) => path,
174-
None => {
175-
eprintln!("Skipping test: vector binary not available");
176-
return;
177-
}
172+
let vector_bin = if let Some(path) = vector_binary_path() { path } else {
173+
eprintln!("Skipping test: vector binary not available");
174+
return;
178175
};
179176

180177
let port = find_available_port().await;
@@ -251,12 +248,9 @@ sinks:
251248
/// Test: Vector sends multiple events and all are received with correct count.
252249
#[tokio::test]
253250
async fn test_vector_grpc_multiple_events() {
254-
let vector_bin = match vector_binary_path() {
255-
Some(path) => path,
256-
None => {
257-
eprintln!("Skipping test: vector binary not available");
258-
return;
259-
}
251+
let vector_bin = if let Some(path) = vector_binary_path() { path } else {
252+
eprintln!("Skipping test: vector binary not available");
253+
return;
260254
};
261255

262256
let port = find_available_port().await;
@@ -335,12 +329,9 @@ sinks:
335329
/// DFE native proto and the Vector proto simultaneously.
336330
#[tokio::test]
337331
async fn test_vector_and_native_coexist() {
338-
let vector_bin = match vector_binary_path() {
339-
Some(path) => path,
340-
None => {
341-
eprintln!("Skipping test: vector binary not available");
342-
return;
343-
}
332+
let vector_bin = if let Some(path) = vector_binary_path() { path } else {
333+
eprintln!("Skipping test: vector binary not available");
334+
return;
344335
};
345336

346337
let port = find_available_port().await;
@@ -497,12 +488,9 @@ async fn test_vector_compat_client_send() {
497488
/// receives and writes the events to the output file.
498489
#[tokio::test]
499490
async fn test_vector_compat_client_to_vector_source() {
500-
let vector_bin = match vector_binary_path() {
501-
Some(path) => path,
502-
None => {
503-
eprintln!("Skipping test: vector binary not available");
504-
return;
505-
}
491+
let vector_bin = if let Some(path) = vector_binary_path() { path } else {
492+
eprintln!("Skipping test: vector binary not available");
493+
return;
506494
};
507495

508496
let port = find_available_port().await;

0 commit comments

Comments
 (0)