/// Collection where an item can be inserted at a given index. pub trait InsertIndex: cc_traits::Collection { type Output; fn insert_index( &mut self, index: usize, element: ::Item, ) -> Self::Output; } #[cfg(feature = "std")] impl InsertIndex for Vec { type Output = (); fn insert_index(&mut self, index: usize, element: T) { self.insert(index, element) } } #[cfg(feature = "smallvec")] impl> InsertIndex for smallvec::SmallVec { type Output = (); fn insert_index(&mut self, index: usize, element: T) { self.insert(index, element) } }