mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-04-20 20:48:43 +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
|
||||
.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)) => (),
|
||||
|
|
Loading…
Add table
Reference in a new issue