From 0bf67d616f5033667a1493e711ffd7ad98c856a7 Mon Sep 17 00:00:00 2001 From: Vadim Petrochenkov Date: Sat, 14 Nov 2015 15:05:20 +0300 Subject: [PATCH] docs: Clarify insertion behavior for maps --- src/libcollections/btree/map.rs | 5 +++-- src/libstd/collections/hash/map.rs | 5 +++-- 2 files changed, 6 insertions(+), 4 deletions(-) diff --git a/src/libcollections/btree/map.rs b/src/libcollections/btree/map.rs index 39925ddff849..178d7a4a0529 100644 --- a/src/libcollections/btree/map.rs +++ b/src/libcollections/btree/map.rs @@ -319,8 +319,9 @@ impl BTreeMap { /// /// If the map did not have this key present, `None` is returned. /// - /// If the map did have this key present, that value is returned, and the - /// entry is not updated. See the [module-level documentation] for more. + /// 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. /// /// [module-level documentation]: index.html#insert-and-complex-keys /// diff --git a/src/libstd/collections/hash/map.rs b/src/libstd/collections/hash/map.rs index 965226f6355c..b8482b3a2dc6 100644 --- a/src/libstd/collections/hash/map.rs +++ b/src/libstd/collections/hash/map.rs @@ -1108,8 +1108,9 @@ impl HashMap /// /// If the map did not have this key present, `None` is returned. /// - /// If the map did have this key present, that value is returned, and the - /// entry is not updated. See the [module-level documentation] for more. + /// 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. /// /// [module-level documentation]: index.html#insert-and-complex-keys ///