Skip to content

Commit

Permalink
fix: ref_as_ptr warnings
Browse files Browse the repository at this point in the history
I chose to ignore the lint in `bevy_mikktspace`, since it needs a refactor and I'd rather not touch it.
  • Loading branch information
BD103 committed Apr 10, 2024
1 parent a907f1b commit 47dc18f
Show file tree
Hide file tree
Showing 2 changed files with 5 additions and 2 deletions.
3 changes: 2 additions & 1 deletion crates/bevy_mikktspace/src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2,7 +2,8 @@
unsafe_op_in_unsafe_fn,
clippy::all,
clippy::undocumented_unsafe_blocks,
clippy::ptr_cast_constness
clippy::ptr_cast_constness,
clippy::ref_as_ptr
)]
// FIXME(3492): remove once docs are ready
#![allow(missing_docs)]
Expand Down
4 changes: 3 additions & 1 deletion crates/bevy_render/src/mesh/mod.rs
Original file line number Diff line number Diff line change
Expand Up @@ -80,6 +80,8 @@ impl Eq for MeshVertexBufferLayoutRef {}

impl Hash for MeshVertexBufferLayoutRef {
fn hash<H: Hasher>(&self, state: &mut H) {
(&*self.0 as *const MeshVertexBufferLayout as usize).hash(state);
// Hash the address of the underlying data, so two layouts that share the same
// `MeshVertexBufferLayout` will have the same hash.
(Arc::as_ptr(&self.0) as usize).hash(state);
}
}

0 comments on commit 47dc18f

Please sign in to comment.