Closed
Description
As we already have get()
and Index
, and also get_mut()
it's strange not to have IndexMut
-- it should be pretty straightforward using get_mut()
:
impl<'a, K, Q, V> IndexMut<&'a Q> for BTreeMap<K, V>
where K: Ord + Borrow<Q>, Q: Ord + ?Sized {
fn index_mut(&mut self, index: &Q) -> &mut Self::Output {
self.get_mut(index).unwrap()
}
}