diff --git a/codex-rs/common/src/fuzzy_match.rs b/codex-rs/common/src/fuzzy_match.rs index fe03a52caf..538ad3f769 100644 --- a/codex-rs/common/src/fuzzy_match.rs +++ b/codex-rs/common/src/fuzzy_match.rs @@ -90,14 +90,20 @@ mod tests { #[test] fn ascii_basic_indices() { - let (idx, _score) = fuzzy_match("hello", "hl").expect("match"); + let (idx, _score) = match fuzzy_match("hello", "hl") { + Some(v) => v, + None => panic!("expected a match"), + }; assert_eq!(idx, vec![0, 2]); } #[test] fn unicode_dotted_i_istanbul_highlighting() { // 'İ' lowercases to two chars (i + combining dot). Ensure index 0 is highlighted once. - let (idx, _score) = fuzzy_match("İstanbul", "is").expect("match"); + let (idx, _score) = match fuzzy_match("İstanbul", "is") { + Some(v) => v, + None => panic!("expected a match"), + }; assert_eq!(idx, vec![0, 1]); } diff --git a/codex-rs/tui/src/bottom_pane/chat_composer.rs b/codex-rs/tui/src/bottom_pane/chat_composer.rs index d08470352f..324db58db4 100644 --- a/codex-rs/tui/src/bottom_pane/chat_composer.rs +++ b/codex-rs/tui/src/bottom_pane/chat_composer.rs @@ -451,7 +451,7 @@ impl ChatComposer<'_> { /// Handle key events when file search popup is visible. fn handle_key_event_with_file_popup(&mut self, key_event: KeyEvent) -> (InputResult, bool) { - let first_line_owned = self.first_line().to_string(); + let _first_line_owned = self.first_line().to_string(); let ActivePopup::File(popup) = &mut self.active_popup else { unreachable!(); }; @@ -1222,7 +1222,9 @@ mod tests { let mut terminal = match Terminal::new(TestBackend::new(100, 10)) { Ok(t) => t, Err(e) => { - eprintln!("Skipping ui_snapshots: failed to create terminal: {e}"); + // Avoid printing directly to stderr/stdout (clippy::print_stderr). + // Log a warning instead and skip the snapshot test. + tracing::warn!("Skipping ui_snapshots: failed to create terminal: {e}"); return; } };