Use AutoAbortJoinHandle::spawn in GhCrateMeta::find

Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
Jiahao XU 2022-08-04 18:33:35 +10:00
parent 5d315ae801
commit 36066fd4df
No known key found for this signature in database
GPG key ID: 591C0B03040416D6

View file

@ -41,13 +41,13 @@ impl super::Fetcher for GhCrateMeta {
let checks = urls
.map(|url| {
let client = self.client.clone();
AutoAbortJoinHandle::new(tokio::spawn(async move {
AutoAbortJoinHandle::spawn(async move {
let url = url?;
info!("Checking for package at: '{url}'");
remote_exists(client, url.clone(), Method::HEAD)
.await
.map(|exists| (url.clone(), exists))
}))
})
})
.collect::<Vec<_>>();