From a1daa3357d5b896815aaa3fff97ba4e28c4cac2f Mon Sep 17 00:00:00 2001 From: aiongg Date: Tue, 24 Nov 2026 20:47:28 +0000 Subject: [PATCH] IME trial: no expect in library code --- crates/ui-contract/src/testing/host_key_trials.rs | 7 +++++-- 1 file changed, 5 insertions(+), 2 deletions(-) diff --git a/crates/ui-contract/src/testing/host_key_trials.rs b/crates/ui-contract/src/testing/host_key_trials.rs index 06702799e..71f62c579 100644 --- a/crates/ui-contract/src/testing/host_key_trials.rs +++ b/crates/ui-contract/src/testing/host_key_trials.rs @@ -202,9 +202,12 @@ fn a_press_during_an_app_editor_s_composition_fences_its_late_ime_events() { Event::Ime(ImeEvent::Commit("Q".to_owned())), ]; frames.frame(late, &mut show); - let ime = frames.ime().expect("the editor writes the pass's IME output"); + let ime = frames.ime(); + assert!(ime.is_some(), "the editor writes the pass's IME output"); + let Some(ime) = ime else { return }; assert!(ime.owner == host_editor_id() && ime.interrupt, "the press interrupts the editor's composition in its own context"); - let reset = ime.reset.expect("the interrupt asks for a reset"); + assert!(ime.reset.is_some(), "the interrupt asks for a reset"); + let Some(reset) = ime.reset else { return }; frames.frame(vec![release(at)], &mut show); frames.frame(Vec::new(), &mut show); assert_eq!(*editor.borrow(), "ab", "the composition's late deletion and commit never reach the editor");