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:
parent
18a3db6aa1
commit
1d356624a1
46 changed files with 165 additions and 271 deletions
|
@ -1231,7 +1231,7 @@ impl Stack {
|
|||
InternalIndex(i) => { i + 1 }
|
||||
_ => { panic!(); }
|
||||
};
|
||||
*self.stack.get_mut(len - 1) = InternalIndex(idx);
|
||||
self.stack[len - 1] = InternalIndex(idx);
|
||||
}
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue