优化: R-PD-10 commands err_str helper 统一错误格式化(87 处)

mod.rs 加 pub fn err_str<E: ToString>,commands/ 10 文件 87 处 .map_err(|e| e.to_string()) → .map_err(err_str),残留 0(10 处复杂表达式 e 用于 format!/anyhow 保留)。行为零变化,统一入口为未来加日志/分类留点。批5,cargo workspace 0
This commit is contained in:
2026-06-15 05:45:04 +08:00
parent fddca9daf1
commit 892a642bd4
11 changed files with 105 additions and 94 deletions

View File

@@ -17,3 +17,9 @@ pub mod workflow;
pub(crate) fn now_millis() -> String {
df_core::now_millis().to_string()
}
/// .map_err 错误格式化统一入口 — 当前行为零变化(仅 e.to_string()),
/// 集中收敛为后续加日志/分类/类型名等扩展留点,替代各处散落的 .map_err(|e| e.to_string())。
pub fn err_str<E: std::string::ToString>(e: E) -> String {
e.to_string()
}