diff options
| author | Jack O'Connor <oconnor663@gmail.com> | 2016-01-30 13:44:45 -0500 |
|---|---|---|
| committer | Jack O'Connor <oconnor663@gmail.com> | 2016-02-15 21:50:30 -0500 |
| commit | 2cac9d7bd3f26072e101ccabcb4913ef05f46d7c (patch) | |
| tree | 596f2c2db9eb2077198e574e233de4fb4150ba4c /src/libstd/collections/hash | |
| parent | 17d284b4b5af8aa2d58c3bf05b937d5b9d1adeb0 (diff) | |
| download | rust-2cac9d7bd3f26072e101ccabcb4913ef05f46d7c.tar.gz rust-2cac9d7bd3f26072e101ccabcb4913ef05f46d7c.zip | |
clarify how insert() doesn't update keys
The first time I read the docs for `insert()`, I thought it was saying it didn't update existing *values*, and I was confused. Reword the docs to make it clear that `insert()` does update values.
Diffstat (limited to 'src/libstd/collections/hash')
| -rw-r--r-- | src/libstd/collections/hash/map.rs | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 586fafc2b4a..7220690469c 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -1157,9 +1157,10 @@ impl<K, V, S> HashMap<K, V, S> /// /// If the map did not have this key present, `None` is returned. /// - /// If the map did have this key present, the key is not updated, the - /// value is updated and the old value is returned. - /// See the [module-level documentation] for more. + /// If the map did have this key present, the value is updated, and the old + /// value is returned. The key is not updated, though; this matters for + /// types that can be `==` without being identical. See the [module-level + /// documentation] for more. /// /// [module-level documentation]: index.html#insert-and-complex-keys /// |
