Skip to content

Commit 77ebb6a

Browse files
Rollup merge of rust-lang#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.
2 parents 78e0a41 + 74b2587 commit 77ebb6a

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

src/libcore/iter/traits.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -260,7 +260,10 @@ impl<I: Iterator> IntoIterator for I {
260260
///
261261
/// Iterators produce a series of values, and collections can also be thought
262262
/// of as a series of values. The `Extend` trait bridges this gap, allowing you
263-
/// to extend a collection by including the contents of that iterator.
263+
/// to extend a collection by including the contents of that iterator. When
264+
/// extending a collection with an already existing key, that entry is updated
265+
/// or, in the case of collections that permit multiple entries with equal
266+
/// keys, that entry is inserted.
264267
///
265268
/// # Examples
266269
///

0 commit comments

Comments
 (0)