From 60cde45eea8c9ab91da58bf63d3daac7710ebe02 Mon Sep 17 00:00:00 2001 From: tali Date: Fri, 14 Apr 2023 20:26:04 -0400 Subject: [PATCH] use casts instead of transmute in mino::Mat::new() --- mino/src/matrix.rs | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/mino/src/matrix.rs b/mino/src/matrix.rs index 7904c28..bdb29c9 100644 --- a/mino/src/matrix.rs +++ b/mino/src/matrix.rs @@ -34,7 +34,7 @@ impl Mat { if data.len() >= i16::MAX as usize { 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(&[]);