Is this code sound? At the moment it requires a custom extremely unsafe `transmute`

function. So I was wondering if I have done this correctly.

```
use std::mem;
use std::mem::MaybeUninit;
use std::ptr;
/// Size-heterogeneous transmutation (seriously unsafe!)
///
/// See `transmute` crate.
#[inline]
unsafe fn transmute<A, B>(a: A) -> B {
let b = ptr::read(&a as *const A as *const B);
mem::forget(a);
b
}
fn init_data<F, T, const M: usize, const N: usize>(mut f: F) -> [[T; M]; N]
where
F: FnMut() -> T,
{
// Safety: `MaybeUninit`s do not require initialization.
let mut data: [[MaybeUninit<T>; M]; N] = unsafe { MaybeUninit::uninit().assume_init() };
for i in 0..N {
for j in 0..M {
data[i][j] = MaybeUninit::new(f());
}
}
// Safety: we initialized everything.
unsafe { transmute::<_, [[T; M]; N]>(data) }
}
fn main() {
let data: [[_; 5]; 10] = init_data(|| vec!["is", "this", "sound", "?"]);
println!("{:#?}", data);
}
```