Skip to content

Commit d7209bf

Browse files
authored
Rollup merge of rust-lang#122739 - Sky9x:insert-put, r=jhpratt
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)
2 parents ffdb147 + 49dd50f commit d7209bf

File tree

2 files changed

+2
-2
lines changed

2 files changed

+2
-2
lines changed

library/std/src/collections/hash/map.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -1101,7 +1101,7 @@ where
11011101
/// ```
11021102
#[inline]
11031103
#[stable(feature = "rust1", since = "1.0.0")]
1104-
#[rustc_confusables("push", "append")]
1104+
#[rustc_confusables("push", "append", "put")]
11051105
pub fn insert(&mut self, k: K, v: V) -> Option<V> {
11061106
self.base.insert(k, v)
11071107
}

library/std/src/collections/hash/set.rs

+1-1
Original file line numberDiff line numberDiff line change
@@ -885,7 +885,7 @@ where
885885
/// ```
886886
#[inline]
887887
#[stable(feature = "rust1", since = "1.0.0")]
888-
#[rustc_confusables("push", "append")]
888+
#[rustc_confusables("push", "append", "put")]
889889
pub fn insert(&mut self, value: T) -> bool {
890890
self.base.insert(value)
891891
}

0 commit comments

Comments
 (0)