debian/missing-sources/tinyvec/src/array/generic_array_impl.rs
raw| 1 | use core::default; |
| 2 | |
| 3 | use super::Array; |
| 4 | use generic_array::{ArrayLength, GenericArray}; |
| 5 | |
| 6 | impl<T: Default, N: ArrayLength> Array for GenericArray<T, N> { |
| 7 | type Item = T; |
| 8 | const CAPACITY: usize = N::USIZE; |
| 9 | |
| 10 | #[inline(always)] |
| 11 | fn as_slice(&self) -> &[T] { |
| 12 | &*self |
| 13 | } |
| 14 | |
| 15 | #[inline(always)] |
| 16 | fn as_slice_mut(&mut self) -> &mut [T] { |
| 17 | &mut *self |
| 18 | } |
| 19 | |
| 20 | #[inline(always)] |
| 21 | fn default() -> Self { |
| 22 | <Self as Default>::default() |
| 23 | } |
| 24 | } |