Skip to content

Commit

Permalink
AsRef<Shape> for Collider
Browse files Browse the repository at this point in the history
  • Loading branch information
Aceeri committed Oct 9, 2023
1 parent 5213f38 commit 4a38bae
Showing 1 changed file with 6 additions and 0 deletions.
6 changes: 6 additions & 0 deletions src/geometry/collider.rs
Original file line number Diff line number Diff line change
Expand Up @@ -97,6 +97,12 @@ impl<'a> From<&'a Collider> for &'a dyn Shape {
}
}

impl AsRef<dyn Shape> for Collider {
fn as_ref(&self) -> &dyn Shape {
&*self.raw
}
}

impl fmt::Debug for Collider {
fn fmt(&self, f: &mut fmt::Formatter<'_>) -> fmt::Result {
self.as_typed_shape().fmt(f)
Expand Down

0 comments on commit 4a38bae

Please sign in to comment.