Skip to content

Commit caea701

Browse files
authored
Auto merge of #234 - thomcc:len_at_most_32, r=mbrubeck
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.
2 parents 158e0cf + 604b3fe commit caea701

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1928,7 +1928,8 @@ macro_rules! impl_array(
19281928

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

0 commit comments

Comments
 (0)