From 2467a41bcef012111662acb926fb414b03c6e33c Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Tue, 27 Dec 2016 14:28:57 +0100 Subject: [PATCH 1/2] Clarify Extend behaviour wrt existing keys --- src/libcore/iter/traits.rs | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/src/libcore/iter/traits.rs b/src/libcore/iter/traits.rs index c5465549adf70..f4b91fa444d7e 100644 --- a/src/libcore/iter/traits.rs +++ b/src/libcore/iter/traits.rs @@ -260,7 +260,8 @@ impl IntoIterator for I { /// /// Iterators produce a series of values, and collections can also be thought /// of as a series of values. The `Extend` trait bridges this gap, allowing you -/// to extend a collection by including the contents of that iterator. +/// to extend a collection by including the contents of that iterator. When +/// extending a collection with an already existing key, that entry is updated. /// /// # Examples /// From 74b25876069ec06e1687e98cdb740743d5b57385 Mon Sep 17 00:00:00 2001 From: Sebastian Hahn Date: Thu, 5 Jan 2017 05:19:54 +0100 Subject: [PATCH 2/2] For Extend, document collections allowing duplicate keys --- src/libcore/iter/traits.rs | 4 +++- 1 file changed, 3 insertions(+), 1 deletion(-) diff --git a/src/libcore/iter/traits.rs b/src/libcore/iter/traits.rs index f4b91fa444d7e..53f6acfd7e1eb 100644 --- a/src/libcore/iter/traits.rs +++ b/src/libcore/iter/traits.rs @@ -261,7 +261,9 @@ impl IntoIterator for I { /// Iterators produce a series of values, and collections can also be thought /// of as a series of values. The `Extend` trait bridges this gap, allowing you /// to extend a collection by including the contents of that iterator. When -/// extending a collection with an already existing key, that entry is updated. +/// extending a collection with an already existing key, that entry is updated +/// or, in the case of collections that permit multiple entries with equal +/// keys, that entry is inserted. /// /// # Examples ///