array_bin_ops/lib.rs
1#![deny(unsafe_op_in_unsafe_fn)]
2#![cfg_attr(not(any(doc, test, feature = "std")), no_std)]
3
4#[cfg(test)]
5mod tests;
6
7pub mod assign;
8pub mod simple;
9mod iter;
10
11#[repr(transparent)]
12pub struct Array<T, const N: usize>(pub [T; N]);
13
14impl<T, const N: usize> Array<T, N> {
15 pub fn new_mut(a: &mut [T; N]) -> &mut Self {
16 // SAFETY:
17 // representation is the same
18 unsafe { &mut *(a.as_mut_ptr().cast()) }
19 }
20}