Skip to content

Commit 00d9db1

Browse files
authored
Added doc about behavior of extend on HashMap
It was unclear what the implementation does when it encounters existing keys. This change makes it clear by documenting the trait impl.
1 parent c6293e3 commit 00d9db1

File tree

1 file changed

+2
-0
lines changed
  • src/libstd/collections/hash

1 file changed

+2
-0
lines changed

src/libstd/collections/hash/map.rs

+2
Original file line numberDiff line numberDiff line change
@@ -2362,6 +2362,8 @@ where
23622362
}
23632363
}
23642364

2365+
/// Inserts all new key-values from the iterator and replaces values with existing
2366+
/// keys with new values returned from the iterator.
23652367
#[stable(feature = "rust1", since = "1.0.0")]
23662368
impl<K, V, S> Extend<(K, V)> for HashMap<K, V, S>
23672369
where

0 commit comments

Comments
 (0)