Add 65536 to the Array impls

This commit is contained in:
bluss
2017-03-25 15:15:07 +01:00
parent cc09d7f17b
commit 2de36ba2ca
2 changed files with 14 additions and 0 deletions
+8
View File
@@ -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,);