]> git.lizzy.rs Git - rust.git/commitdiff
Rollup merge of #23559 - aturon:future-proof-map-index, r=Gankro
authorManish Goregaokar <manishsmail@gmail.com>
Sat, 21 Mar 2015 20:05:39 +0000 (01:35 +0530)
committerManish Goregaokar <manishsmail@gmail.com>
Sun, 22 Mar 2015 23:24:26 +0000 (04:54 +0530)
 This commit removes the `IndexMut` impls on `HashMap` and `BTreeMap`, in
order to future-proof the API against the eventual inclusion of an
`IndexSet` trait.

Ideally, we would eventually be able to support:

```rust
map[owned_key] = val;
map[borrowed_key].mutating_method(arguments);
&mut map[borrowed_key];
```

but to keep the design space as unconstrained as possible, we do not
currently want to support `IndexMut`, in case some other strategy will
eventually be needed.

Code currently using mutating index notation can use `get_mut` instead.

[breaking-change]

Closes #23448

r? @Gankro


Trivial merge