Update sipper and relax Send requirements
This commit is contained in:
parent
c8981d0096
commit
7ba2e39133
3 changed files with 9 additions and 11 deletions
5
Cargo.lock
generated
5
Cargo.lock
generated
|
|
@ -5230,11 +5230,12 @@ checksum = "56199f7ddabf13fe5074ce809e7d3f42b42ae711800501b5b16ea82ad029c39d"
|
|||
|
||||
[[package]]
|
||||
name = "sipper"
|
||||
version = "0.0.4"
|
||||
version = "0.0.5"
|
||||
source = "registry+https://github.com/rust-lang/crates.io-index"
|
||||
checksum = "d936de9741a68cb9452b683ffcc1fce44be7a79446ac5918319a42738da2d165"
|
||||
checksum = "273c7573677e3835339763d44dd6ee0683b92108d04b311108809e9819f4bc13"
|
||||
dependencies = [
|
||||
"futures",
|
||||
"pin-project-lite",
|
||||
]
|
||||
|
||||
[[package]]
|
||||
|
|
|
|||
|
|
@ -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"
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
})))
|
||||
}
|
||||
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue