From 54b5c52db2d6f64802af37a3aea9653ebf1e6b0b Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?H=C3=A9ctor=20Ram=C3=B3n=20Jim=C3=A9nez?= Date: Wed, 12 Nov 2025 14:34:10 +0100 Subject: [PATCH] Take `Program` by reference in `iced_test::screenshot` --- test/src/lib.rs | 8 ++++---- 1 file changed, 4 insertions(+), 4 deletions(-) diff --git a/test/src/lib.rs b/test/src/lib.rs index b13e779e..7704d477 100644 --- a/test/src/lib.rs +++ b/test/src/lib.rs @@ -221,7 +221,7 @@ pub fn run( /// Takes a screenshot of the given [`Program`](program::Program) with the given theme, viewport, /// and scale factor after running it for the given [`Duration`]. pub fn screenshot( - program: P, + program: &P, theme: &P::Theme, viewport: impl Into, scale_factor: f32, @@ -233,7 +233,7 @@ pub fn screenshot( let mut emulator = Emulator::new( sender, - &program, + program, emulator::Mode::Immediate, viewport.into(), ); @@ -244,7 +244,7 @@ pub fn screenshot( if let Some(event) = receiver.try_next().ok().flatten() { match event { emulator::Event::Action(action) => { - emulator.perform(&program, action); + emulator.perform(program, action); } emulator::Event::Failed(_) => { unreachable!( @@ -262,5 +262,5 @@ pub fn screenshot( std::thread::sleep(Duration::from_millis(1)); } - emulator.screenshot(&program, theme, scale_factor) + emulator.screenshot(program, theme, scale_factor) }