panic on otherwise ignored errors in debug mode

Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
Jason Volk 2024-11-25 01:14:12 +00:00
parent 29c715a45f
commit 6f1d50dda3

View file

@ -13,6 +13,15 @@ where
T: Stream<Item = Result<Item>> + TryStream + Send + 'a,
Item: Send + 'a,
{
#[cfg(debug_assertions)]
#[inline]
fn ignore_err(self: T) -> impl Stream<Item = Item> + Send + 'a {
use super::TryExpect;
self.expect_ok()
}
#[cfg(not(debug_assertions))]
#[inline]
fn ignore_err(self: T) -> impl Stream<Item = Item> + Send + 'a { self.filter_map(|res| ready(res.ok())) }