panic on otherwise ignored errors in debug mode
Signed-off-by: Jason Volk <jason@zemos.net>
This commit is contained in:
parent
29c715a45f
commit
6f1d50dda3
1 changed files with 9 additions and 0 deletions
|
@ -13,6 +13,15 @@ where
|
||||||
T: Stream<Item = Result<Item>> + TryStream + Send + 'a,
|
T: Stream<Item = Result<Item>> + TryStream + Send + 'a,
|
||||||
Item: 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]
|
#[inline]
|
||||||
fn ignore_err(self: T) -> impl Stream<Item = Item> + Send + 'a { self.filter_map(|res| ready(res.ok())) }
|
fn ignore_err(self: T) -> impl Stream<Item = Item> + Send + 'a { self.filter_map(|res| ready(res.ok())) }
|
||||||
|
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue