From 9552e0e8eddaec767b3cf61e54c0c5e502995311 Mon Sep 17 00:00:00 2001 From: Jiahao XU Date: Mon, 18 Jul 2022 17:31:29 +1000 Subject: [PATCH] Add comment to `entry` to improve readbility Signed-off-by: Jiahao XU --- src/main.rs | 6 ++++++ 1 file changed, 6 insertions(+) diff --git a/src/main.rs b/src/main.rs index a324108a..7ed9199b 100644 --- a/src/main.rs +++ b/src/main.rs @@ -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 = 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| {