Skip to content

Commit

Permalink
Rollup merge of #122739 - Sky9x:insert-put, r=jhpratt
Browse files Browse the repository at this point in the history
Add "put" as a confusable for insert on hash map/set

Already a confusable on btree map/set.

Java's `Map` calls the insert method `put`: https://docs.oracle.com/en/java/javase/17/docs/api/java.base/java/util/Map.html#put(K,V)
  • Loading branch information
matthiaskrgr committed Mar 20, 2024
2 parents ffdb147 + 49dd50f commit d7209bf
Show file tree
Hide file tree
Showing 2 changed files with 2 additions and 2 deletions.
2 changes: 1 addition & 1 deletion library/std/src/collections/hash/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -1101,7 +1101,7 @@ where
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_confusables("push", "append")]
#[rustc_confusables("push", "append", "put")]
pub fn insert(&mut self, k: K, v: V) -> Option<V> {
self.base.insert(k, v)
}
Expand Down
2 changes: 1 addition & 1 deletion library/std/src/collections/hash/set.rs
Original file line number Diff line number Diff line change
Expand Up @@ -885,7 +885,7 @@ where
/// ```
#[inline]
#[stable(feature = "rust1", since = "1.0.0")]
#[rustc_confusables("push", "append")]
#[rustc_confusables("push", "append", "put")]
pub fn insert(&mut self, value: T) -> bool {
self.base.insert(value)
}
Expand Down

0 comments on commit d7209bf

Please sign in to comment.