about summary refs log tree commit diff
diff options
context:
space:
mode:
authorGuillaume Gomez <guillaume1.gomez@gmail.com>2017-01-13 10:42:26 +0100
committerGitHub <noreply@github.com>2017-01-13 10:42:26 +0100
commit77ebb6a572f381eba70bf0243b8ae19a8003d54b (patch)
treebff5ee7ecfd5d5a8335850e62d71714eb4657616
parent78e0a417efcc444a5f76d5535103f92e594a81d9 (diff)
parent74b25876069ec06e1687e98cdb740743d5b57385 (diff)
downloadrust-77ebb6a572f381eba70bf0243b8ae19a8003d54b.tar.gz
rust-77ebb6a572f381eba70bf0243b8ae19a8003d54b.zip
Rollup merge of #38636 - shahn:extend, r=steveklabnik
Clarify Extend behaviour wrt existing keys

This seems to be consistent with all the Extend implementations I found, and isn't documented anywhere else afaik.
-rw-r--r--src/libcore/iter/traits.rs5
1 files changed, 4 insertions, 1 deletions
diff --git a/src/libcore/iter/traits.rs b/src/libcore/iter/traits.rs
index 25406696620..1e127148300 100644
--- a/src/libcore/iter/traits.rs
+++ b/src/libcore/iter/traits.rs
@@ -260,7 +260,10 @@ impl<I: Iterator> 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
+/// or, in the case of collections that permit multiple entries with equal
+/// keys, that entry is inserted.
 ///
 /// # Examples
 ///