Closed
Description
Does this seem like a bug, or am I missing something? There is no need for mutable borrowing here.
impl<'a, K, V, S, A: Allocator + Clone> RawOccupiedEntryMut<'a, K, V, S, A> {
/// Gets a reference to the key and value in the entry.
#[cfg_attr(feature = "inline-more", inline)]
pub fn get_key_value(&mut self) -> (&K, &V) {
unsafe {
let &(ref key, ref value) = self.elem.as_ref();
(key, value)
}
}
}
I noticed it when I wrote an example for this function, and the compiler: make the variable mutable
! Me: wait, what😂?
Metadata
Metadata
Assignees
Labels
No labels