From 47f570d5aefc19163e54575c81770c531610e977 Mon Sep 17 00:00:00 2001 From: xqqmdy Date: Fri, 30 Oct 2026 18:57:29 +0800 Subject: [PATCH 1/2] chore: drop redundant references in write! args clippy 1.99 (useless_borrows_in_formatting) denies these under -D warnings; local pre-push CI runs clippy with a newer toolchain than the one that last touched src/ui.rs, so the hook fails on main without this. --- src/ui.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/src/ui.rs b/src/ui.rs index 85df93e..791b65b 100644 --- a/src/ui.rs +++ b/src/ui.rs @@ -200,7 +200,7 @@ impl Theme for ConfirmTheme { write!( f, "{} {} ", - &self.base.prompt_prefix, + self.base.prompt_prefix, self.base.prompt_style.apply_to(prompt) )?; } @@ -220,7 +220,7 @@ impl Theme for ConfirmTheme { brackets.apply_to("/"), no, brackets.apply_to("]"), - &self.base.prompt_suffix + self.base.prompt_suffix ), Some(true) => write!( f, @@ -230,7 +230,7 @@ impl Theme for ConfirmTheme { brackets.apply_to("/"), no, brackets.apply_to("]"), - &self.base.prompt_suffix, + self.base.prompt_suffix, self.base.defaults_style.apply_to("yes") ), Some(false) => write!( @@ -241,7 +241,7 @@ impl Theme for ConfirmTheme { brackets.apply_to("/"), no_default, brackets.apply_to("]"), - &self.base.prompt_suffix, + self.base.prompt_suffix, self.base.defaults_style.apply_to("no") ), } From d24a1f79ac824387c8f45175e5a5f1cf9bd00f04 Mon Sep 17 00:00:00 2001 From: xqqmdy Date: Fri, 30 Oct 2026 19:28:58 +0800 Subject: [PATCH 2/2] fix(test): make setup_label assertion color-independent setup_label embeds ANSI styling via tier_token, so asserting on the raw string fails on terminals that force colors (CLICOLOR_FORCE=1), e.g. when the pre-push hook runs cargo test from an interactive shell. Strip the escape codes before asserting. --- src/asr_model.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/asr_model.rs b/src/asr_model.rs index d2a0ad5..f8e18b1 100644 --- a/src/asr_model.rs +++ b/src/asr_model.rs @@ -455,6 +455,8 @@ mod tests { fn large_v3_turbo_is_marked_recommended() { let info = find_model("large-v3-turbo").expect("turbo info"); assert_eq!(info.support_tier, SupportTier::Recommended); - assert!(setup_label(info).contains("[Recommended ]")); + // setup_label embeds ANSI styling (tier_token); strip it so the + // assertion holds on color-forced terminals (CLICOLOR_FORCE=1). + assert!(console::strip_ansi_codes(&setup_label(info)).contains("[Recommended ]")); } }