Disallow empty samples

This commit is contained in:
Izzy Swart 2021-07-05 19:53:24 -07:00
parent 5caab575af
commit 17b76c9a8e
1 changed files with 5 additions and 1 deletions

View File

@ -114,7 +114,11 @@ async fn main() -> Result<(), Box<dyn Error>> {
"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<dyn Error>);