Vendor things
This commit is contained in:
parent
5deceec006
commit
977e3c17e5
19434 changed files with 10682014 additions and 0 deletions
23
third-party/vendor/tinyvec/src/array/const_generic_impl.rs
vendored
Normal file
23
third-party/vendor/tinyvec/src/array/const_generic_impl.rs
vendored
Normal file
|
|
@ -0,0 +1,23 @@
|
|||
use super::Array;
|
||||
|
||||
impl<T: Default, const N: usize> Array for [T; N] {
|
||||
type Item = T;
|
||||
const CAPACITY: usize = N;
|
||||
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn as_slice(&self) -> &[T] {
|
||||
&*self
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
#[must_use]
|
||||
fn as_slice_mut(&mut self) -> &mut [T] {
|
||||
&mut *self
|
||||
}
|
||||
|
||||
#[inline(always)]
|
||||
fn default() -> Self {
|
||||
[(); N].map(|_| Default::default())
|
||||
}
|
||||
}
|
||||
Loading…
Add table
Add a link
Reference in a new issue