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:
@@ -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();
|
||||
|
||||
Reference in New Issue
Block a user