mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-21 13:08:42 +00:00
Slightly more ergo clone by ordering
This commit is contained in:
parent
d59fd60e8a
commit
aad708a035
1 changed files with 5 additions and 9 deletions
|
@ -62,17 +62,13 @@ impl MultiFetcher {
|
||||||
.fetchers
|
.fetchers
|
||||||
.iter()
|
.iter()
|
||||||
.cloned()
|
.cloned()
|
||||||
.map(|fetcher| {
|
.map(|fetcher| (
|
||||||
let fetcher_cloned = fetcher.clone();
|
fetcher.clone(),
|
||||||
|
AutoAbortJoinHandle(tokio::spawn(async move { fetcher.check().await })),
|
||||||
(
|
))
|
||||||
AutoAbortJoinHandle(tokio::spawn(async move { fetcher.check().await })),
|
|
||||||
fetcher_cloned,
|
|
||||||
)
|
|
||||||
})
|
|
||||||
.collect();
|
.collect();
|
||||||
|
|
||||||
for (mut handle, fetcher) in handles {
|
for (fetcher, mut handle) in handles {
|
||||||
match (&mut handle.0).await {
|
match (&mut handle.0).await {
|
||||||
Ok(Ok(true)) => return Some(fetcher),
|
Ok(Ok(true)) => return Some(fetcher),
|
||||||
Ok(Ok(false)) => (),
|
Ok(Ok(false)) => (),
|
||||||
|
|
Loading…
Add table
Reference in a new issue