mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-07 12:40:04 +00:00
Add comment to entry
to improve readbility
Signed-off-by: Jiahao XU <Jiahao_XU@outlook.com>
This commit is contained in:
parent
79ec122647
commit
9552e0e8ed
1 changed files with 6 additions and 0 deletions
|
@ -225,8 +225,10 @@ async fn entry() -> Result<()> {
|
|||
)
|
||||
.unwrap();
|
||||
|
||||
// Initialize UI thread
|
||||
let mut uithread = UIThread::new(!opts.no_confirm);
|
||||
|
||||
// Launch target detection
|
||||
let desired_targets = get_desired_targets(&opts.targets);
|
||||
|
||||
// Compute install directory
|
||||
|
@ -245,6 +247,7 @@ async fn entry() -> Result<()> {
|
|||
|
||||
let temp_dir_path: Arc<Path> = Arc::from(temp_dir.path());
|
||||
|
||||
// Resolve crates
|
||||
let tasks: Vec<_> = crate_names
|
||||
.into_iter()
|
||||
.map(|crate_name| {
|
||||
|
@ -269,6 +272,7 @@ async fn entry() -> Result<()> {
|
|||
);
|
||||
|
||||
let tasks: Vec<_> = if !opts.dry_run && !opts.no_confirm {
|
||||
// Confirm
|
||||
let mut resolutions = Vec::with_capacity(tasks.len());
|
||||
for task in tasks {
|
||||
resolutions.push(await_task(task).await??);
|
||||
|
@ -276,6 +280,7 @@ async fn entry() -> Result<()> {
|
|||
|
||||
uithread.confirm().await?;
|
||||
|
||||
// Install
|
||||
resolutions
|
||||
.into_iter()
|
||||
.map(|resolution| {
|
||||
|
@ -288,6 +293,7 @@ async fn entry() -> Result<()> {
|
|||
})
|
||||
.collect()
|
||||
} else {
|
||||
// Install without confirm
|
||||
tasks
|
||||
.into_iter()
|
||||
.map(|task| {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue