From 17b76c9a8eea94489593d8f0e71bf308cf473363 Mon Sep 17 00:00:00 2001 From: Izzy Swart Date: Mon, 5 Jul 2021 19:53:24 -0700 Subject: [PATCH] Disallow empty samples --- src/main.rs | 6 +++++- 1 file changed, 5 insertions(+), 1 deletion(-) diff --git a/src/main.rs b/src/main.rs index 229b3bc..7cbc317 100644 --- a/src/main.rs +++ b/src/main.rs @@ -114,7 +114,11 @@ async fn main() -> Result<(), Box> { "1".to_string(), ], ) - .into_stream(), + .into_stream() + .try_filter(|message| { + let not_empty = !message.is_empty(); + async move { not_empty } + }), ) .map_err(|e| Box::new(e) as Box);