Slightly more ergo clone by ordering

This commit is contained in:
Félix Saparelli 2022-06-08 16:43:18 +12:00
parent d59fd60e8a
commit aad708a035
No known key found for this signature in database
GPG key ID: B948C4BAE44FC474

View file

@ -62,17 +62,13 @@ impl MultiFetcher {
.fetchers
.iter()
.cloned()
.map(|fetcher| {
let fetcher_cloned = fetcher.clone();
(
AutoAbortJoinHandle(tokio::spawn(async move { fetcher.check().await })),
fetcher_cloned,
)
})
.map(|fetcher| (
fetcher.clone(),
AutoAbortJoinHandle(tokio::spawn(async move { fetcher.check().await })),
))
.collect();
for (mut handle, fetcher) in handles {
for (fetcher, mut handle) in handles {
match (&mut handle.0).await {
Ok(Ok(true)) => return Some(fetcher),
Ok(Ok(false)) => (),