Add 65536 to the Array impls
This commit is contained in:
@@ -46,6 +46,13 @@ impl Index for u16 {
|
||||
fn from(ix: usize) -> Self { ix as u16 }
|
||||
}
|
||||
|
||||
impl Index for u32 {
|
||||
#[inline(always)]
|
||||
fn to_usize(self) -> usize { self as usize }
|
||||
#[inline(always)]
|
||||
fn from(ix: usize) -> Self { ix as u32 }
|
||||
}
|
||||
|
||||
impl Index for usize {
|
||||
#[inline(always)]
|
||||
fn to_usize(self) -> usize { self }
|
||||
@@ -80,4 +87,5 @@ fix_array_impl_recursive!(u8, 0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14,
|
||||
16, 17, 18, 19, 20, 21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31,
|
||||
32, 40, 48, 50, 56, 64, 72, 96, 100, 128, 160, 192, 200, 224,);
|
||||
fix_array_impl_recursive!(u16, 256, 384, 512, 768, 1024, 2048, 4096, 8192, 16384, 32768,);
|
||||
fix_array_impl_recursive!(u32, 1 << 16,);
|
||||
|
||||
|
||||
@@ -450,3 +450,9 @@ fn test_pop_at() {
|
||||
assert_eq!(v.pop_at(2), None);
|
||||
assert_eq!(&v[..], &["a", "d"]);
|
||||
}
|
||||
|
||||
#[test]
|
||||
fn test_sizes() {
|
||||
let v = ArrayVec::from([0u8; 1 << 16]);
|
||||
assert_eq!(vec![0u8; v.len()], &v[..]);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user