vec_btree_map/index.rs
1use crate::VecBTreeMap;
2use core::ops::{Index, IndexMut};
3
4impl<K, V> Index<usize> for VecBTreeMap<K, V> {
5 type Output = V;
6
7 #[inline]
8 fn index(&self, i: usize) -> &Self::Output {
9 &self.base.index(i).1
10 }
11}
12
13impl<K, V> IndexMut<usize> for VecBTreeMap<K, V> {
14 #[inline]
15 fn index_mut(&mut self, i: usize) -> &mut Self::Output {
16 &mut self.base.index_mut(i).1
17 }
18}