Skip to content

Commit

Permalink
refactor: prefer ptr::cast to as casting
Browse files Browse the repository at this point in the history
  • Loading branch information
ErichDonGubler committed Dec 22, 2023
1 parent e1baa5a commit 62c01d5
Showing 1 changed file with 2 additions and 3 deletions.
5 changes: 2 additions & 3 deletions wgpu-hal/src/gles/command.rs
Original file line number Diff line number Diff line change
Expand Up @@ -81,9 +81,8 @@ impl super::CommandBuffer {
}

fn add_push_constant_data(&mut self, data: &[u32]) -> Range<u32> {
let data_raw = unsafe {
std::slice::from_raw_parts(data.as_ptr() as *const _, mem::size_of_val(data))
};
let data_raw =
unsafe { std::slice::from_raw_parts(data.as_ptr().cast(), mem::size_of_val(data)) };
let start = self.data_bytes.len();
assert!(start < u32::MAX as usize);
self.data_bytes.extend_from_slice(data_raw);
Expand Down

0 comments on commit 62c01d5

Please sign in to comment.