From 885e402e382a1a9e04b428466db4839d44369104 Mon Sep 17 00:00:00 2001 From: Jason Volk Date: Sat, 24 Jan 2026 04:16:09 +0000 Subject: [PATCH] Lower generics on OptionExt to function prototypes. Signed-off-by: Jason Volk --- src/core/utils/option.rs | 32 +++++++++++++++----------------- 1 file changed, 15 insertions(+), 17 deletions(-) diff --git a/src/core/utils/option.rs b/src/core/utils/option.rs index e3002690..b917116a 100644 --- a/src/core/utils/option.rs +++ b/src/core/utils/option.rs @@ -2,19 +2,19 @@ use futures::{FutureExt, Stream, future::OptionFuture}; use super::IterStream; -pub trait OptionExt -where - Fut: Future + Send, - U: Send, -{ - fn map_async(self, f: F) -> OptionFuture - where - F: FnOnce(T) -> Fut; - - #[inline] - fn map_stream(self, f: F) -> impl Stream + Send +pub trait OptionExt { + fn map_async(self, f: F) -> OptionFuture where F: FnOnce(T) -> Fut, + Fut: Future + Send, + U: Send; + + #[inline] + fn map_stream(self, f: F) -> impl Stream + Send + where + F: FnOnce(T) -> Fut, + Fut: Future + Send, + U: Send, Self: Sized, { self.map_async(f) @@ -24,15 +24,13 @@ where } } -impl OptionExt for Option -where - Fut: Future + Send, - U: Send, -{ +impl OptionExt for Option { #[inline] - fn map_async(self, f: F) -> OptionFuture + fn map_async(self, f: F) -> OptionFuture where F: FnOnce(T) -> Fut, + Fut: Future + Send, + U: Send, { self.map(f).into() }