From 7ba2e3913395b212c7789569e1d683e7766cc348 Mon Sep 17 00:00:00 2001 From: Héctor Ramón Jiménez Date: Sun, 9 Feb 2025 21:05:42 +0100 Subject: Update `sipper` and relax `Send` requirements --- runtime/src/task.rs | 13 +++++-------- 1 file changed, 5 insertions(+), 8 deletions(-) (limited to 'runtime') diff --git a/runtime/src/task.rs b/runtime/src/task.rs index fb46ca45..989f0ed5 100644 --- a/runtime/src/task.rs +++ b/runtime/src/task.rs @@ -63,18 +63,15 @@ impl Task { /// progress with the first closure and the output with the second one. pub fn sip( sipper: S, - on_progress: impl Fn(Progress) -> T + Send + 'static, - on_output: impl FnOnce(Output) -> T + Send + 'static, + on_progress: impl Fn(Progress) -> T + MaybeSend + 'static, + on_output: impl FnOnce(Output) -> T + MaybeSend + 'static, ) -> Self where - S: Sipper + Send + 'static, - S::Future: Send + 'static, - Output: Send, - Progress: Send, - T: Send + 'static, + S: Sipper + MaybeSend + 'static, + T: MaybeSend + 'static, { Self::stream(stream(sipper::sipper(move |sender| async move { - on_output(sipper.map(on_progress).run(sender).await) + on_output(sipper.with(on_progress).run(sender).await) }))) } -- cgit