arrayvec
                                
                                
                                
                                    arrayvec copied to clipboard
                            
                            
                            
                        Feature request: Implement `Index` and `IndexMut`
For code which is generic over the Index or IndexMut traits, it would be helpful if ArrayVec would implement the Index and IndexMut traits (in core::ops). I understand and like that you prefer ArrayVec methods not to panic but rather return a Result or Option, and I see I can use the get and get_mut functions and then unwrap myself, but for code generic over these traits this does not help (much).
Precedence for implementing Index<I> and IndexMut<I> where I: SliceIndex<[T]> (even though the methods may panic):
- (primitive) arrays
 std::vec::Vecsmallvec::SmallVec(from the popularsmallveccrate)tinyvec::ArrayVec(from thetinyveccrate)
Now panic or not has nothing to do with it, you can already index arrayvec because it derefs to slice. If possible in a good way, we should impl Index too. The complexity of slice's index impls could make them hard to match(?)
you can already index arrayvec because it derefs to slice
Ah, didn't think of that. I created a PR which implements Index and IndexMut (also through).