From 4093c89ba4b7b1107e3c748346209442d164112a Mon Sep 17 00:00:00 2001 From: Asger Hautop Drewsen Date: Fri, 20 Sep 2024 11:36:41 +0200 Subject: [PATCH] Simplify implementation --- src/concurrent_stream/from_concurrent_stream.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/concurrent_stream/from_concurrent_stream.rs b/src/concurrent_stream/from_concurrent_stream.rs index b0f874d..7fd1db3 100644 --- a/src/concurrent_stream/from_concurrent_stream.rs +++ b/src/concurrent_stream/from_concurrent_stream.rs @@ -116,13 +116,13 @@ where async fn progress(self: Pin<&mut Self>) -> super::ConsumerState { let mut this = self.project(); + let Ok(items) = this.output else { + return ConsumerState::Break; + }; while let Some(item) = this.group.next().await { match item { Ok(item) => { - let Ok(items) = this.output else { - panic!("progress called after returning ConsumerState::Break"); - }; items.push(item); } Err(e) => {