Skip to content

Commit

Permalink
Impl AsRef<Array<T, U>> for [T; N] (#9)
Browse files Browse the repository at this point in the history
  • Loading branch information
tarcieri authored Jan 11, 2024
1 parent 1905e76 commit 7c37040
Showing 1 changed file with 11 additions and 0 deletions.
11 changes: 11 additions & 0 deletions src/lib.rs
Original file line number Diff line number Diff line change
Expand Up @@ -267,6 +267,17 @@ where
}
}

impl<T, U, const N: usize> AsRef<Array<T, U>> for [T; N]
where
Array<T, U>: ArrayOps<T, N>,
U: ArraySize,
{
#[inline]
fn as_ref(&self) -> &Array<T, U> {
Array::ref_from_core_array(self)
}
}

impl<T, U> AsMut<[T]> for Array<T, U>
where
U: ArraySize,
Expand Down

0 comments on commit 7c37040

Please sign in to comment.