From 7bf362e4cd397e7486d6b4373088aeff7ee14c5c Mon Sep 17 00:00:00 2001 From: Philipp Oppermann Date: Thu, 5 Jan 2023 14:13:37 +0100 Subject: [PATCH] Ignore late latency messages --- examples/benchmark/sink/src/main.rs | 16 +++++++++------- 1 file changed, 9 insertions(+), 7 deletions(-) diff --git a/examples/benchmark/sink/src/main.rs b/examples/benchmark/sink/src/main.rs index 94c2516b..49c207cd 100644 --- a/examples/benchmark/sink/src/main.rs +++ b/examples/benchmark/sink/src/main.rs @@ -30,14 +30,16 @@ fn main() -> eyre::Result<()> { } match input.id.as_str() { - "latency" => {} - "throughput" => { - if latency { - latency = false; - println!("Throughput:"); - } + "latency" if latency => {} + "throughput" if latency => { + latency = false; + println!("Throughput:"); + } + "throughput" => {} + other => { + eprintln!("Ignoring unexpected input `{other}`"); + continue; } - other => eprintln!("Ignoring unexpected input `{other}`"), } n += 1;