Skip to content
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
21 changes: 14 additions & 7 deletions src/map.rs
Original file line number Diff line number Diff line change
Expand Up @@ -4131,7 +4131,8 @@ impl<'a, 'b, K, Q: ?Sized, V, S, A: Allocator> EntryRef<'a, 'b, K, Q, V, S, A> {
#[cfg_attr(feature = "inline-more", inline)]
pub fn insert(self, value: V) -> OccupiedEntry<'a, K, V, S, A>
where
K: Hash + From<&'b Q>,
K: Hash,
&'b Q: Into<K>,
S: BuildHasher,
{
match self {
Expand Down Expand Up @@ -4164,7 +4165,8 @@ impl<'a, 'b, K, Q: ?Sized, V, S, A: Allocator> EntryRef<'a, 'b, K, Q, V, S, A> {
#[cfg_attr(feature = "inline-more", inline)]
pub fn or_insert(self, default: V) -> &'a mut V
where
K: Hash + From<&'b Q>,
K: Hash,
&'b Q: Into<K>,
S: BuildHasher,
{
match self {
Expand Down Expand Up @@ -4194,7 +4196,8 @@ impl<'a, 'b, K, Q: ?Sized, V, S, A: Allocator> EntryRef<'a, 'b, K, Q, V, S, A> {
#[cfg_attr(feature = "inline-more", inline)]
pub fn or_insert_with<F: FnOnce() -> V>(self, default: F) -> &'a mut V
where
K: Hash + From<&'b Q>,
K: Hash,
&'b Q: Into<K>,
S: BuildHasher,
{
match self {
Expand Down Expand Up @@ -4225,7 +4228,8 @@ impl<'a, 'b, K, Q: ?Sized, V, S, A: Allocator> EntryRef<'a, 'b, K, Q, V, S, A> {
#[cfg_attr(feature = "inline-more", inline)]
pub fn or_insert_with_key<F: FnOnce(&Q) -> V>(self, default: F) -> &'a mut V
where
K: Hash + Borrow<Q> + From<&'b Q>,
K: Hash + Borrow<Q>,
&'b Q: Into<K>,
S: BuildHasher,
{
match self {
Expand Down Expand Up @@ -4320,7 +4324,8 @@ impl<'a, 'b, K, Q: ?Sized, V: Default, S, A: Allocator> EntryRef<'a, 'b, K, Q, V
#[cfg_attr(feature = "inline-more", inline)]
pub fn or_default(self) -> &'a mut V
where
K: Hash + From<&'b Q>,
K: Hash,
&'b Q: Into<K>,
S: BuildHasher,
{
match self {
Expand Down Expand Up @@ -4368,7 +4373,8 @@ impl<'a, 'b, K, Q: ?Sized, V, S, A: Allocator> VacantEntryRef<'a, 'b, K, Q, V, S
#[cfg_attr(feature = "inline-more", inline)]
pub fn insert(self, value: V) -> &'a mut V
where
K: Hash + From<&'b Q>,
K: Hash,
&'b Q: Into<K>,
S: BuildHasher,
{
let table = &mut self.table.table;
Expand Down Expand Up @@ -4399,7 +4405,8 @@ impl<'a, 'b, K, Q: ?Sized, V, S, A: Allocator> VacantEntryRef<'a, 'b, K, Q, V, S
#[cfg_attr(feature = "inline-more", inline)]
pub fn insert_entry(self, value: V) -> OccupiedEntry<'a, K, V, S, A>
where
K: Hash + From<&'b Q>,
K: Hash,
&'b Q: Into<K>,
S: BuildHasher,
{
let elem = self.table.table.insert(
Expand Down