Skip to content

Commit

Permalink
Auto merge of #234 - thomcc:len_at_most_32, r=mbrubeck
Browse files Browse the repository at this point in the history
Implement Array for all sizes <= 32

Most traits supported by arrays are fully supported for arrays in the Rust stdlib as for all sizes <= 32. I was surprised to find that `SmallVec<[T; 18]>` (I happen to know that 18 the maximum outside of obscure cases) isn't possible because smallvec::Array is not consistent with this pattern.

Of course, I don't actually need this — I can just choose another size, but it seems like it would be good/unsurprising to be a superset of libstd's choices here.
  • Loading branch information
bors-servo committed Sep 8, 2020
2 parents 158e0cf + 604b3fe commit caea701
Showing 1 changed file with 2 additions and 1 deletion.
3 changes: 2 additions & 1 deletion src/lib.rs
Expand Up @@ -1928,7 +1928,8 @@ macro_rules! impl_array(

#[cfg(not(feature = "const_generics"))]
impl_array!(
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 20, 24, 32, 36, 0x40, 0x60, 0x80,
0, 1, 2, 3, 4, 5, 6, 7, 8, 9, 10, 11, 12, 13, 14, 15, 16, 17, 18, 19, 20,
21, 22, 23, 24, 25, 26, 27, 28, 29, 30, 31, 32, 36, 0x40, 0x60, 0x80,
0x100, 0x200, 0x400, 0x600, 0x800, 0x1000, 0x2000, 0x4000, 0x6000, 0x8000, 0x10000, 0x20000,
0x40000, 0x60000, 0x80000, 0x10_0000
);
Expand Down

0 comments on commit caea701

Please sign in to comment.