mirror of
https://github.com/cargo-bins/cargo-binstall.git
synced 2025-05-07 20:50:03 +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();
|
.unwrap();
|
||||||
|
|
||||||
|
// Initialize UI thread
|
||||||
let mut uithread = UIThread::new(!opts.no_confirm);
|
let mut uithread = UIThread::new(!opts.no_confirm);
|
||||||
|
|
||||||
|
// Launch target detection
|
||||||
let desired_targets = get_desired_targets(&opts.targets);
|
let desired_targets = get_desired_targets(&opts.targets);
|
||||||
|
|
||||||
// Compute install directory
|
// Compute install directory
|
||||||
|
@ -245,6 +247,7 @@ async fn entry() -> Result<()> {
|
||||||
|
|
||||||
let temp_dir_path: Arc<Path> = Arc::from(temp_dir.path());
|
let temp_dir_path: Arc<Path> = Arc::from(temp_dir.path());
|
||||||
|
|
||||||
|
// Resolve crates
|
||||||
let tasks: Vec<_> = crate_names
|
let tasks: Vec<_> = crate_names
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|crate_name| {
|
.map(|crate_name| {
|
||||||
|
@ -269,6 +272,7 @@ async fn entry() -> Result<()> {
|
||||||
);
|
);
|
||||||
|
|
||||||
let tasks: Vec<_> = if !opts.dry_run && !opts.no_confirm {
|
let tasks: Vec<_> = if !opts.dry_run && !opts.no_confirm {
|
||||||
|
// Confirm
|
||||||
let mut resolutions = Vec::with_capacity(tasks.len());
|
let mut resolutions = Vec::with_capacity(tasks.len());
|
||||||
for task in tasks {
|
for task in tasks {
|
||||||
resolutions.push(await_task(task).await??);
|
resolutions.push(await_task(task).await??);
|
||||||
|
@ -276,6 +280,7 @@ async fn entry() -> Result<()> {
|
||||||
|
|
||||||
uithread.confirm().await?;
|
uithread.confirm().await?;
|
||||||
|
|
||||||
|
// Install
|
||||||
resolutions
|
resolutions
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|resolution| {
|
.map(|resolution| {
|
||||||
|
@ -288,6 +293,7 @@ async fn entry() -> Result<()> {
|
||||||
})
|
})
|
||||||
.collect()
|
.collect()
|
||||||
} else {
|
} else {
|
||||||
|
// Install without confirm
|
||||||
tasks
|
tasks
|
||||||
.into_iter()
|
.into_iter()
|
||||||
.map(|task| {
|
.map(|task| {
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue