diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-18 10:59:46 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-18 10:59:46 +0800 |
| commit | 78776ff4a91c470f075aa5148e48c02ca6e4d050 (patch) | |
| tree | b072f4ca72679be50c1fe155b1651ded82cad4e7 /mingling_ci/src/task/run.rs | |
| parent | b47a1fb1dd5b82ba14bcf8589c5b2a604569bf19 (diff) | |
refactor(ci-new): extract shared task progress bar helper
Diffstat (limited to 'mingling_ci/src/task/run.rs')
| -rw-r--r-- | mingling_ci/src/task/run.rs | 15 |
1 files changed, 3 insertions, 12 deletions
diff --git a/mingling_ci/src/task/run.rs b/mingling_ci/src/task/run.rs index bf83d3b..ba752dd 100644 --- a/mingling_ci/src/task/run.rs +++ b/mingling_ci/src/task/run.rs @@ -2,8 +2,8 @@ use std::ffi::OsString; use std::path::Path; use colored::Colorize; -use indicatif::{ProgressBar, ProgressStyle}; +use crate::progress::task_progress_bar; use crate::reporter::{self, ReportResult}; /// The manifest's parent directory, e.g. `./mingling` — the report location @@ -33,17 +33,8 @@ pub(crate) async fn run_parallel_checks( reporter::set_task(task); let n = tasks.len(); - let pb = ProgressBar::new(n as u64); - let padding = " ".repeat(12usize.saturating_sub(phase.len())); - let styled_prefix = format!("{}{}", padding, phase.bold().bright_cyan()); - pb.set_style( - ProgressStyle::default_bar() - .template(&format!( - "{styled_prefix} [{{bar:28}}] {{pos}}/{{len}}: {{msg}}" - )) - .unwrap() - .progress_chars("=> "), - ); + let pb = task_progress_bar(n, phase); + pb.set_message("tasks"); // Run each task in parallel. let mut set = tokio::task::JoinSet::new(); |
