mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-13 23:40:03 +00:00
Impl AutoAbortJoinHandle::new
& make its field private
plus change all its users to use its new APIs. Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
f41391a53c
commit
d9bcca8b78
2 changed files with 12 additions and 6 deletions
|
@ -64,13 +64,13 @@ impl MultiFetcher {
|
|||
.map(|fetcher| {
|
||||
(
|
||||
fetcher.clone(),
|
||||
AutoAbortJoinHandle(tokio::spawn(async move { fetcher.check().await })),
|
||||
AutoAbortJoinHandle::new(tokio::spawn(async move { fetcher.check().await })),
|
||||
)
|
||||
})
|
||||
.collect();
|
||||
|
||||
for (fetcher, mut handle) in handles {
|
||||
match (&mut handle.0).await {
|
||||
for (fetcher, handle) in handles {
|
||||
match handle.await {
|
||||
Ok(Ok(true)) => return Some(fetcher),
|
||||
Ok(Ok(false)) => (),
|
||||
Ok(Err(err)) => {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue