use casts instead of transmute in mino::Mat::new()

This commit is contained in:
tali 2023-04-14 20:26:04 -04:00
parent 5e069cf3ff
commit 60cde45eea
1 changed files with 1 additions and 1 deletions

View File

@ -34,7 +34,7 @@ impl Mat {
if data.len() >= i16::MAX as usize { if data.len() >= i16::MAX as usize {
panic!("matrix height overflows i16"); panic!("matrix height overflows i16");
} }
unsafe { core::mem::transmute(data) } unsafe { &*(data as *const [u16] as *const Self) }
} }
pub const EMPTY: &'static Self = Self::new(&[]); pub const EMPTY: &'static Self = Self::new(&[]);