From e4255d5ae9a3fd6e82f89d1f42ca5afbc243495d Mon Sep 17 00:00:00 2001 From: 魏曹先生 <1992414357@qq.com> Date: Sun, 15 Mar 2026 14:28:30 +0800 Subject: Add .gitignore for policy directory and improve logging output --- src/bin/butckrepo-refresh.rs | 30 ++++++++++++++++++------------ 1 file changed, 18 insertions(+), 12 deletions(-) (limited to 'src/bin') diff --git a/src/bin/butckrepo-refresh.rs b/src/bin/butckrepo-refresh.rs index ea7e753..9003575 100644 --- a/src/bin/butckrepo-refresh.rs +++ b/src/bin/butckrepo-refresh.rs @@ -58,7 +58,8 @@ async fn main() { let cargo_toml_pathes = find_cargo_toml_dirs(¤t_dir.join("policy")).await; println!( - "Found {} crates, register to `{}`", + "{} {} crates, register to `{}`", + "Found".bright_blue().bold(), cargo_toml_pathes.len(), CARGO_TOML_PATH.bright_green() ); @@ -207,19 +208,24 @@ async fn collect(policy_crate_path: &Path) -> Option { stream_struct_id, ) = collect_matched_func(lib_rs_content.as_str())?; - println!( - "{} {} (at: `{}`) with func `{}{}{}{}(..)`", - "Register:".bright_blue().bold(), - crate_name, - crate_path.bright_green(), - "pub ".bright_magenta(), - if matched_func_has_await { "async " } else { "" }.bright_magenta(), - "fn ".bright_magenta(), - matched_func.bright_blue(), - ); + if !matched_func.is_empty() { + println!( + "{} {} (at: `{}`) with func `{}{}{}{}(..)`", + "Register:".bright_blue().bold(), + crate_name, + crate_path.bright_green(), + "pub ".bright_magenta(), + if matched_func_has_await { "async " } else { "" }.bright_magenta(), + "fn ".bright_magenta(), + matched_func.bright_blue(), + ); + } if let Some(stream_func) = &matched_func_stream { println!( - " and stream func `{}{}{}{}(..)`", + "{} {} (at: `{}`) with stream func `{}{}{}{}(..)`", + "Register:".bright_blue().bold(), + crate_name, + crate_path.bright_green(), "pub ".bright_magenta(), if matched_func_stream_has_await { "async " -- cgit