From a1742ab01e89336b381bdc6592fd7326cf0b1438 Mon Sep 17 00:00:00 2001 From: "Dylan M. Taylor" Date: Fri, 20 Nov 2026 07:42:15 -0500 Subject: [PATCH] rustfmt batch 10 --- crates/ui-contract/src/primitives/sensing.rs | 5 ++--- crates/ui-contract/tests/it/runtime/pointer.rs | 10 ++++++++-- crates/ui-patterns/tests/it/docking/columns.rs | 12 ++++++++---- 3 files changed, 18 insertions(+), 9 deletions(-) diff --git a/crates/ui-contract/src/primitives/sensing.rs b/crates/ui-contract/src/primitives/sensing.rs index 38c181406..c64b58c1f 100644 --- a/crates/ui-contract/src/primitives/sensing.rs +++ b/crates/ui-contract/src/primitives/sensing.rs @@ -778,9 +778,8 @@ pub(crate) fn sense_members(ui: &Ui, arena: ArenaId, specs: &[MemberSpec<'_>]) - let layer = ui.layer_id(); let pass_nr = pass::pass_nr(ctx, pass::current_viewport(ctx)); // One read of the pointer and one of the arena serve the joins, the outcome and the part results. - let (pointer_pos, target, sample) = pointer::with_frame(ctx, |frame, hover| { - (hover, frame.map_or(0.0, |frame| frame.target), frame.and_then(|frame| frame.sample)) - }); + let (pointer_pos, target, sample) = + pointer::with_frame(ctx, |frame, hover| (hover, frame.map_or(0.0, |frame| frame.target), frame.and_then(|frame| frame.sample))); let mut shapes = Vec::new(); let mut joined = Vec::with_capacity(specs.len()); let recording = crate::runtime::replay::recording(ctx); diff --git a/crates/ui-contract/tests/it/runtime/pointer.rs b/crates/ui-contract/tests/it/runtime/pointer.rs index a5bacd965..6ea48a99f 100644 --- a/crates/ui-contract/tests/it/runtime/pointer.rs +++ b/crates/ui-contract/tests/it/runtime/pointer.rs @@ -25,7 +25,10 @@ fn quick_presses_count_clicks_with_their_own_modifiers() { }); }; let button = |pressed, modifiers| egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed, modifiers }; - frames.frame(vec![pointer::moved(at), button(true, egui::Modifiers::SHIFT), button(false, egui::Modifiers::SHIFT), button(true, egui::Modifiers::NONE)], &mut show); + frames.frame( + vec![pointer::moved(at), button(true, egui::Modifiers::SHIFT), button(false, egui::Modifiers::SHIFT), button(true, egui::Modifiers::NONE)], + &mut show, + ); frames.idle(1, &mut show); assert_eq!(counts, vec![1, 1], "a change in modifiers starts a new click sequence"); } @@ -38,7 +41,10 @@ fn a_press_uses_its_event_modifiers_when_the_frame_has_released_them() { frames.idle(2, &mut show); let at = area.center(); frames.frame(vec![pointer::moved(at)], &mut show); - frames.frame(vec![egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed: true, modifiers: egui::Modifiers::SHIFT }], &mut show); + frames.frame( + vec![egui::Event::PointerButton { pos: at, button: egui::PointerButton::Primary, pressed: true, modifiers: egui::Modifiers::SHIFT }], + &mut show, + ); assert!(log.borrow().last().root.press.mods.shift, "the press reads Shift even after the frame has released it"); } diff --git a/crates/ui-patterns/tests/it/docking/columns.rs b/crates/ui-patterns/tests/it/docking/columns.rs index 71b7c6cb1..2e88f70af 100644 --- a/crates/ui-patterns/tests/it/docking/columns.rs +++ b/crates/ui-patterns/tests/it/docking/columns.rs @@ -298,9 +298,10 @@ fn rail_footer_stays_clear_of_icons_on_either_dock_side() { let seen = Rc::clone(&actions); let mut fixture = Fixture::new(move |ui| { let mut workspace = held.borrow().clone(); - let out = DockArea::new("Rail dock", Bind::given(workspace.clone()), &mut RailWithFooter, DockConfig::default().iconic_mode(IconicMode::Rail)) - .rail_footer(10) - .show(ui); + let out = + DockArea::new("Rail dock", Bind::given(workspace.clone()), &mut RailWithFooter, DockConfig::default().iconic_mode(IconicMode::Rail)) + .rail_footer(10) + .show(ui); for action in out.actions { drop(workspace.apply(action.clone(), false, |_| Permissions::ALL)); seen.borrow_mut().push(action); @@ -326,7 +327,10 @@ fn rail_footer_stays_clear_of_icons_on_either_dock_side() { assert!(last.bottom() <= after.top() && last.top() >= 0.0, "scrolling brings the last icon above the controls: {last:?}, {after:?}"); let last = fixture.by_label("Panel 29").expect("the last icon can be clicked"); fixture.click(&last).settle(); - assert!(actions.borrow().iter().any(|action| matches!(action, Action::Activate { panel: 29, .. })), "the scrolled icon still activates its panel"); + assert!( + actions.borrow().iter().any(|action| matches!(action, Action::Activate { panel: 29, .. })), + "the scrolled icon still activates its panel" + ); let expanded = fixture.by_label("Rail controls").expect("the controls remain on the expanded rail").rect; assert!((expanded.center().x - footer.center().x).abs() < footer.width(), "the controls stay at the same dock edge when expanded"); }