diff options
| author | 魏曹先生 <1992414357@qq.com> | 2026-08-19 05:54:00 +0800 |
|---|---|---|
| committer | 魏曹先生 <1992414357@qq.com> | 2026-08-19 06:15:20 +0800 |
| commit | ec9edc294fd5e7e29977fc7b0e6fb953422bc0e2 (patch) | |
| tree | bbf89ef4457b8de8a8a9bca5668045d612d27572 /mingling_ci/src/cmd/cmd_report_clean.rs | |
| parent | 06dfc27194c11e1d1033c292c759a1c5d82e780b (diff) | |
Move CI, dev tools, and configs from root-level scattered locations into
a
unified `dev/` directory structure. Update all references across build
scripts, documentation, and editor configurations.
Also consolidate editor config generation into build.rs for automated
synchronization of rust-analyzer settings across VS Code and Zed.
Diffstat (limited to 'mingling_ci/src/cmd/cmd_report_clean.rs')
| -rw-r--r-- | mingling_ci/src/cmd/cmd_report_clean.rs | 54 |
1 files changed, 0 insertions, 54 deletions
diff --git a/mingling_ci/src/cmd/cmd_report_clean.rs b/mingling_ci/src/cmd/cmd_report_clean.rs deleted file mode 100644 index 976851e..0000000 --- a/mingling_ci/src/cmd/cmd_report_clean.rs +++ /dev/null @@ -1,54 +0,0 @@ -use std::path::PathBuf; - -use mingling::{ - Grouped, RenderResult, Routable, - macros::{buffer, command, r_println, renderer}, -}; - -use crate::Next; -use crate::reporter::{COLLECT_DIR, REPORT_PATH}; -use crate::res::{CargoError, MessagePrinter}; - -/// Removes collected logs and the generated report. -#[command(node = "report-clean")] -pub fn report_clean() -> Next { - let mut removed = Vec::new(); - for path in [PathBuf::from(COLLECT_DIR), PathBuf::from(REPORT_PATH)] { - match std::fs::remove_dir_all(&path).or_else(|_| std::fs::remove_file(&path)) { - Ok(()) => removed.push(path), - Err(e) if e.kind() == std::io::ErrorKind::NotFound => {} - Err(e) => { - return ErrorReportClean(format!("failed to remove {}: {e}", path.display())) - .to_chain(); - } - } - } - ResultReportClean { removed }.to_chain() -} - -/// Paths removed by `report-clean`. -#[derive(Grouped)] -pub struct ResultReportClean { - pub removed: Vec<PathBuf>, -} - -#[derive(Grouped, Default)] -pub struct ErrorReportClean(pub String); - -#[renderer(buffer)] -pub fn render_report_clean(r: ResultReportClean) { - if r.removed.is_empty() { - r_println!("Report data already clean"); - } else { - for path in r.removed { - r_println!("Removed {}", path.display()); - } - } -} - -#[renderer] -pub fn render_error_report_clean(e: ErrorReportClean, error: &CargoError) -> RenderResult { - let render_result = RenderResult::new(); - error.println(vec![format!("Report: {}", e.0)]); - render_result -} |
