Skip to content

Commit 1eb078f

Browse files
committed
use set_if_neq
1 parent 82220d0 commit 1eb078f

File tree

1 file changed

+1
-3
lines changed

1 file changed

+1
-3
lines changed

crates/bevy_ui/src/focus.rs

Lines changed: 1 addition & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -164,9 +164,7 @@ pub fn ui_focus_system(
164164
// Reset their interaction to None to avoid strange stuck state
165165
if let Some(mut interaction) = node.interaction {
166166
// We cannot simply set the interaction to None, as that will trigger change detection repeatedly
167-
if *interaction != Interaction::None {
168-
*interaction = Interaction::None;
169-
}
167+
interaction.set_if_neq(Interaction::None);
170168
}
171169

172170
return None;

0 commit comments

Comments
 (0)