mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-06-15 23:26:36 +00:00
Apply cargo fmt
This commit is contained in:
parent
615779187c
commit
2aeaa32c68
2 changed files with 8 additions and 6 deletions
|
@ -1,7 +1,7 @@
|
||||||
use std::{future::Future, pin::Pin, fmt::Debug};
|
use std::{fmt::Debug, future::Future, pin::Pin};
|
||||||
|
|
||||||
use tracing::warn;
|
|
||||||
use tokio::sync::mpsc;
|
use tokio::sync::mpsc;
|
||||||
|
use tracing::warn;
|
||||||
|
|
||||||
/// Given multiple futures with output = `Result<Option<T>, E>`,
|
/// Given multiple futures with output = `Result<Option<T>, E>`,
|
||||||
/// returns the the first one that returns either `Err(_)` or
|
/// returns the the first one that returns either `Err(_)` or
|
||||||
|
@ -73,7 +73,7 @@ impl<T: Send + 'static, E: Send + Debug + 'static> FuturesResolver<T, E> {
|
||||||
let mut rx = self.rx;
|
let mut rx = self.rx;
|
||||||
drop(self.tx);
|
drop(self.tx);
|
||||||
|
|
||||||
async move {
|
async move {
|
||||||
while let Some(res) = rx.recv().await {
|
while let Some(res) = rx.recv().await {
|
||||||
match res {
|
match res {
|
||||||
Ok(ret) => return Some(ret),
|
Ok(ret) => return Some(ret),
|
||||||
|
|
|
@ -139,8 +139,7 @@ async fn resolve_inner(
|
||||||
target_data,
|
target_data,
|
||||||
opts.signature_policy,
|
opts.signature_policy,
|
||||||
);
|
);
|
||||||
filter_fetcher_by_name_predicate(fetcher.fetcher_name())
|
filter_fetcher_by_name_predicate(fetcher.fetcher_name()).then_some(fetcher)
|
||||||
.then_some(fetcher)
|
|
||||||
}),
|
}),
|
||||||
)
|
)
|
||||||
};
|
};
|
||||||
|
@ -167,7 +166,10 @@ async fn resolve_inner(
|
||||||
|
|
||||||
for fetcher in handles {
|
for fetcher in handles {
|
||||||
fetcher.clone().report_to_upstream();
|
fetcher.clone().report_to_upstream();
|
||||||
match AutoAbortJoinHandle::new(fetcher.clone().find()).flattened_join().await {
|
match AutoAbortJoinHandle::new(fetcher.clone().find())
|
||||||
|
.flattened_join()
|
||||||
|
.await
|
||||||
|
{
|
||||||
Ok(true) => {
|
Ok(true) => {
|
||||||
// Generate temporary binary path
|
// Generate temporary binary path
|
||||||
let bin_path = opts.temp_dir.join(format!(
|
let bin_path = opts.temp_dir.join(format!(
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue