Skip to content

Commit a48628a

Browse files
committed
Fix clippy errors
1 parent 04e5d7a commit a48628a

File tree

1 file changed

+7
-11
lines changed

1 file changed

+7
-11
lines changed

crates/bevy_ui/src/focus.rs

Lines changed: 7 additions & 11 deletions
Original file line numberDiff line numberDiff line change
@@ -166,16 +166,14 @@ pub fn ui_focus_system(
166166

167167
if contains_cursor {
168168
return Some(entity);
169-
} else {
170-
if let Some(mut interaction) = interaction {
171-
if *interaction == Interaction::Hovered
172-
|| (cursor_position.is_none() && *interaction != Interaction::None)
173-
{
174-
*interaction = Interaction::None;
175-
}
169+
} else if let Some(mut interaction) = interaction {
170+
if *interaction == Interaction::Hovered
171+
|| (cursor_position.is_none() && *interaction != Interaction::None)
172+
{
173+
*interaction = Interaction::None;
176174
}
177-
return None;
178175
}
176+
return None;
179177
}
180178
None
181179
})
@@ -210,13 +208,11 @@ pub fn ui_focus_system(
210208
}
211209
// reset lower nodes to None
212210
for entity in &moused_over_nodes {
213-
if let Ok((_, _, _, interaction, _, _, _)) = node_query.get_mut(*entity) {
214-
if let Some(mut interaction) = interaction {
211+
if let Ok((_, _, _, Some(mut interaction), _, _, _)) = node_query.get_mut(*entity) {
215212
// don't reset clicked nodes because they're handled separately
216213
if *interaction != Interaction::Clicked && *interaction != Interaction::None {
217214
*interaction = Interaction::None;
218215
}
219-
}
220216
}
221217
}
222218
}

0 commit comments

Comments
 (0)