Skip to content

Commit

Permalink
Move the MutableEntryKey::key_mut doc to the trait
Browse files Browse the repository at this point in the history
  • Loading branch information
cuviper committed Aug 21, 2024
1 parent b66bbfe commit b44138b
Showing 1 changed file with 3 additions and 3 deletions.
6 changes: 3 additions & 3 deletions src/map/mutable.rs
Original file line number Diff line number Diff line change
Expand Up @@ -106,6 +106,9 @@ where
/// This trait is sealed and cannot be implemented for types outside this crate.
pub trait MutableEntryKey: private::Sealed {
type Key;

/// Gets a mutable reference to the entry's key, either within the map if occupied,
/// or else the new key that was used to find the entry.
fn key_mut(&mut self) -> &mut Self::Key;
}

Expand All @@ -114,9 +117,6 @@ pub trait MutableEntryKey: private::Sealed {
/// See [`MutableEntryKey`] for more information.
impl<K, V> MutableEntryKey for Entry<'_, K, V> {
type Key = K;

/// Gets a mutable reference to the entry's key, either within the map if occupied,
/// or else the new key that was used to find the entry.
fn key_mut(&mut self) -> &mut Self::Key {
match self {
Entry::Occupied(e) => e.key_mut(),
Expand Down

0 comments on commit b44138b

Please sign in to comment.