Browse Source

fix epaint bytemuck dependency (#2913)

pull/2919/head
Ryan Hileman 2 years ago
committed by GitHub
parent
commit
116d1547be
No known key found for this signature in database GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      crates/epaint/src/image.rs

2
crates/epaint/src/image.rs

@ -111,11 +111,13 @@ impl ColorImage {
}
/// A view of the underlying data as `&[u8]`
#[cfg(feature = "bytemuck")]
pub fn as_raw(&self) -> &[u8] {
bytemuck::cast_slice(&self.pixels)
}
/// A view of the underlying data as `&mut [u8]`
#[cfg(feature = "bytemuck")]
pub fn as_raw_mut(&mut self) -> &mut [u8] {
bytemuck::cast_slice_mut(&mut self.pixels)
}

Loading…
Cancel
Save