Skip to content

Commit

Permalink
Added doc about behavior of extend on HashMap
Browse files Browse the repository at this point in the history
It was unclear what the implementation does when it encounters existing keys. This change makes it clear by documenting the trait impl.
  • Loading branch information
Kixunil authored Oct 3, 2019
1 parent c6293e3 commit 00d9db1
Showing 1 changed file with 2 additions and 0 deletions.
2 changes: 2 additions & 0 deletions src/libstd/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -2362,6 +2362,8 @@ where
}
}

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

0 comments on commit 00d9db1

Please sign in to comment.