Use AutoAbortJoinHandle::spawn in MultiFetcher::add

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

View file

@ -64,7 +64,7 @@ impl MultiFetcher {
pub fn add(&mut self, fetcher: Arc<dyn Fetcher>) {
self.0.push((
fetcher.clone(),
AutoAbortJoinHandle::new(tokio::spawn(async move { fetcher.find().await })),
AutoAbortJoinHandle::spawn(async move { fetcher.find().await }),
));
}