#[stable(feature = "rust1", since = "1.0.0")]
impl<V> IndexMut<usize> for VecMap<V> {
- type Output = V;
-
#[inline]
fn index_mut<'a>(&'a mut self, i: &usize) -> &'a mut V {
self.get_mut(i).expect("key not present")
use prelude::*;
use core::hash::{hash, SipHasher};
- use super::{VecMap, Occupied, Vacant};
+ use super::VecMap;
+ use super::Entry::{Occupied, Vacant};
#[test]
fn test_get_mut() {
assert!(m.insert(10, 11).is_none());
for (k, v) in &mut m {
- *v += k as int;
+ *v += k as isize;
}
let mut it = m.iter();
assert!(m.insert(10, 11).is_none());
for (k, v) in m.iter_mut().rev() {
- *v += k as int;
+ *v += k as isize;
}
let mut it = m.iter();