collections: Enable IndexMut for some collections

This commit enables implementations of IndexMut for a number of collections,
including Vec, RingBuf, SmallIntMap, TrieMap, TreeMap, and HashMap. At the same
time this deprecates the `get_mut` methods on vectors in favor of using the
indexing notation.

cc #18424
This commit is contained in:
Alex Crichton
2014-10-23 08:42:21 -07:00
parent 18a3db6aa1
commit 1d356624a1
46 changed files with 165 additions and 271 deletions

View File

@@ -978,7 +978,7 @@ fn combine_ranges(unordered: Vec<(char, char)>) -> Vec<(char, char)> {
}
match which {
None => ordered.push((us, ue)),
Some(i) => *ordered.get_mut(i) = (us, ue),
Some(i) => ordered[i] = (us, ue),
}
}
ordered.sort();