diff --git a/crates/ui-egui/src/tools/move_locked_nudge_alert_tests.rs b/crates/ui-egui/src/tools/move_locked_nudge_alert_tests.rs index b9fc9f16a7..53a55a536e 100644 --- a/crates/ui-egui/src/tools/move_locked_nudge_alert_tests.rs +++ b/crates/ui-egui/src/tools/move_locked_nudge_alert_tests.rs @@ -13,6 +13,9 @@ use super::{MESSAGE, NUDGE_MESSAGE}; use crate::PhotocraftApp; use crate::state::Tool; +/// A name and the locks it sets. +type LockCase = (&'static str, fn(&mut Locks)); + /// A document of a Background and one red-filled layer, the Move tool picked and the layer selected. fn harness() -> Harness<'static, Box> { let mut h = Harness::builder().with_size(egui::vec2(1400.0, 900.0)).with_max_steps(64).build_eframe(|cc| { @@ -78,7 +81,7 @@ fn press(h: &mut Harness<'_, Box>, mods: Modifiers, key: Key) { #[test] fn a_nudge_of_a_layer_locked_in_place_opens_one_alert_of_its_own() { - let cases: [(&str, fn(&mut Locks)); 3] = [("Lock all", |l| l.all = true), ("Lock position", |l| l.position = true), ("Background", |_| {})]; + let cases: [LockCase; 3] = [("Lock all", |l| l.all = true), ("Lock position", |l| l.position = true), ("Background", |_| {})]; for (name, lock) in cases { for mods in [Modifiers::NONE, Modifiers::SHIFT] { let mut h = harness(); @@ -125,8 +128,7 @@ fn enter_space_escape_and_ok_close_the_alert_and_no_press_is_replayed() { #[test] fn layers_with_only_a_pixel_lock_still_nudge() { - let cases: [(&str, fn(&mut Locks)); 3] = - [("no lock", |_| {}), ("Lock image pixels", |l| l.pixels = true), ("Lock transparent pixels", |l| l.transparency = true)]; + let cases: [LockCase; 3] = [("no lock", |_| {}), ("Lock image pixels", |l| l.pixels = true), ("Lock transparent pixels", |l| l.transparency = true)]; for (name, lock) in cases { let mut h = harness(); let id = layer(&h);