Skip to content

Commit

Permalink
Remove unwrap from update_aabb_intervals
Browse files Browse the repository at this point in the history
  • Loading branch information
Jondolf committed Jun 24, 2023
1 parent e0a4ba4 commit 1b86e0a
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion src/plugins/broad_phase.rs
Original file line number Diff line number Diff line change
Expand Up @@ -43,7 +43,9 @@ struct AabbIntervals(Vec<(Entity, ColliderAabb)>);
/// Updates [`AabbIntervals`] to keep them in sync with the [`ColliderAabb`]s.
fn update_aabb_intervals(aabbs: Query<&ColliderAabb>, mut intervals: ResMut<AabbIntervals>) {
for (ent, aabb) in intervals.0.iter_mut() {
*aabb = *aabbs.get(*ent).unwrap();
if let Ok(new_aabb) = aabbs.get(*ent) {
*aabb = *new_aabb;
}
}
}

Expand Down

0 comments on commit 1b86e0a

Please sign in to comment.