From 3af5280ea6cc6cb5500c63d5b4d25be4a95abf37 Mon Sep 17 00:00:00 2001 From: Nigel Ihza Firdausy <106657905+Ni-zav@users.noreply.github.com> Date: Mon, 12 Oct 2026 09:27:55 +0700 Subject: [PATCH] Keep selection test independent of the visible list's mutable borrow --- crates/ui-egui/src/panels/presets.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/crates/ui-egui/src/panels/presets.rs b/crates/ui-egui/src/panels/presets.rs index 165c194ce..e2e97dfa9 100644 --- a/crates/ui-egui/src/panels/presets.rs +++ b/crates/ui-egui/src/panels/presets.rs @@ -289,7 +289,8 @@ mod tests { let pid = "lc.golden-hour"; session.execute("preset.apply", &json!({"id": pid})).unwrap(); let state = AppliedPreset::new(&session, pid.into(), 100.0); - let other = session.visible().iter().copied().find(|id| Some(*id) != session.active()).unwrap(); + let active = session.active(); + let other = session.visible().iter().copied().find(|id| Some(*id) != active).unwrap(); session.execute("library.select", &json!({"ids": [other.0]})).unwrap(); assert!(!state.is_current(&session), "the preset belongs to the earlier selection"); }