From 6f1d50dda31b4c5d55e2297c701520553ba8327e Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Mon, 25 Nov 2024 01:14:12 +0000 Subject: [PATCH] panic on otherwise ignored errors in debug mode Signed-off-by: Jason Volk --- src/core/utils/stream/ignore.rs | 9 +++++++++ 1 file changed, 9 insertions(+) diff --git a/src/core/utils/stream/ignore.rs b/src/core/utils/stream/ignore.rs index 997aa4ba..4e426557 100644 --- a/src/core/utils/stream/ignore.rs +++ b/src/core/utils/stream/ignore.rs @@ -13,6 +13,15 @@ where T: Stream> + TryStream + Send + 'a, Item: Send + 'a, { + #[cfg(debug_assertions)] + #[inline] + fn ignore_err(self: T) -> impl Stream + Send + 'a { + use super::TryExpect; + + self.expect_ok() + } + + #[cfg(not(debug_assertions))] #[inline] fn ignore_err(self: T) -> impl Stream + Send + 'a { self.filter_map(|res| ready(res.ok())) }