Skip to content

Commit

Permalink
Update sipper and relax Send requirements
Browse files Browse the repository at this point in the history
  • Loading branch information
hecrj committed Feb 9, 2025
1 parent c8981d0 commit 7ba2e39
Show file tree
Hide file tree
Showing 3 changed files with 9 additions and 11 deletions.
5 changes: 3 additions & 2 deletions Cargo.lock

Some generated files are not rendered by default. Learn more about how customized files appear on GitHub.

2 changes: 1 addition & 1 deletion Cargo.toml
Original file line number Diff line number Diff line change
Expand Up @@ -172,7 +172,7 @@ raw-window-handle = "0.6"
resvg = "0.42"
rustc-hash = "2.0"
sha2 = "0.10"
sipper = "0.0.4"
sipper = "0.0.5"
smol = "1.0"
smol_str = "0.2"
softbuffer = "0.4"
Expand Down
13 changes: 5 additions & 8 deletions runtime/src/task.rs
Original file line number Diff line number Diff line change
Expand Up @@ -63,18 +63,15 @@ impl<T> Task<T> {
/// progress with the first closure and the output with the second one.
pub fn sip<S, Output, Progress>(
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<Output, Progress> + Send + 'static,
S::Future: Send + 'static,
Output: Send,
Progress: Send,
T: Send + 'static,
S: Sipper<Output, Progress> + 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)
})))
}

Expand Down

0 comments on commit 7ba2e39

Please sign in to comment.