From c9ab1786337bf784725c557e90bf09432bff7e01 Mon Sep 17 00:00:00 2001 From: drendog Date: Sun, 18 Jan 2026 22:35:51 +0100 Subject: [PATCH] refactor: remove unnecessary mutability on selection --- crates/composition/src/lock_selection.rs | 4 ++-- crates/composition/src/selection.rs | 4 ++-- 2 files changed, 4 insertions(+), 4 deletions(-) diff --git a/crates/composition/src/lock_selection.rs b/crates/composition/src/lock_selection.rs index 60e4684..0de0f89 100644 --- a/crates/composition/src/lock_selection.rs +++ b/crates/composition/src/lock_selection.rs @@ -26,7 +26,7 @@ impl<'a> LockSelection<'a> { /// Handler receives a `CallbackContext` with surface identity and shell control. /// Callbacks are stored and applied when the lock is activated, and automatically /// applied to new surfaces when outputs are hotplugged during an active lock. - pub fn on_callback(&mut self, callback_name: &str, handler: F) -> &mut Self + pub fn on_callback(&self, callback_name: &str, handler: F) -> &Self where F: Fn(crate::CallbackContext) -> R + Clone + 'static, R: crate::IntoValue, @@ -37,7 +37,7 @@ impl<'a> LockSelection<'a> { } /// Registers a callback handler that receives arguments for all matching lock surfaces - pub fn on_callback_with_args(&mut self, callback_name: &str, handler: F) -> &mut Self + pub fn on_callback_with_args(&self, callback_name: &str, handler: F) -> &Self where F: Fn(&[Value], crate::CallbackContext) -> R + Clone + 'static, R: crate::IntoValue, diff --git a/crates/composition/src/selection.rs b/crates/composition/src/selection.rs index a475d28..7fb7063 100644 --- a/crates/composition/src/selection.rs +++ b/crates/composition/src/selection.rs @@ -94,7 +94,7 @@ impl<'a> Selection<'a> { /// Registers a callback handler for all matching surfaces /// /// Handler receives a `CallbackContext` with surface identity and shell control. - pub fn on_callback(&mut self, callback_name: &str, handler: F) -> &mut Self + pub fn on_callback(&self, callback_name: &str, handler: F) -> &Self where F: Fn(crate::CallbackContext) -> R + Clone + 'static, R: crate::IntoValue, @@ -105,7 +105,7 @@ impl<'a> Selection<'a> { } /// Registers a callback handler that receives arguments for all matching surfaces - pub fn on_callback_with_args(&mut self, callback_name: &str, handler: F) -> &mut Self + pub fn on_callback_with_args(&self, callback_name: &str, handler: F) -> &Self where F: Fn(&[Value], crate::CallbackContext) -> R + Clone + 'static, R: crate::IntoValue,