From d30f9ea16384b31fd00a646ecc7ca144fe23e885 Mon Sep 17 00:00:00 2001 From: Steven Enamakel Date: Thu, 15 Oct 2026 17:46:21 +0300 Subject: [PATCH] test(browser): borrow press action before approval target call Restructure the press approval assertion to bind the action to a local variable before passing it to approval_target, avoiding a temporary that outlives the borrow. Auto-committed-on: dragonfly --- .../src/tools/impl/browser/browser_computer_tests.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/crates/openhuman-core/src/tools/impl/browser/browser_computer_tests.rs b/crates/openhuman-core/src/tools/impl/browser/browser_computer_tests.rs index 41f53932745..79e1f455557 100644 --- a/crates/openhuman-core/src/tools/impl/browser/browser_computer_tests.rs +++ b/crates/openhuman-core/src/tools/impl/browser/browser_computer_tests.rs @@ -86,10 +86,11 @@ fn approval_describes_selector_and_locator_targets() { assert!(locator.contains("Role locator") && locator.contains("Email")); assert!(!locator.contains("private@example.com")); - let (reference, press) = approval_target(&Action::Press { + let press_action = Action::Press { key: "Enter".into(), target: Some(Target::reference("e7")), - }); + }; + let (reference, press) = approval_target(&press_action); assert_eq!(reference, Some("e7")); assert_eq!(press, " @e7"); let (_, untargeted) = approval_target(&Action::Press {