fix lifetimes

This commit is contained in:
janis 2025-09-19 14:43:59 +02:00
parent a280b83479
commit a74adaa293
Signed by: janis
SSH key fingerprint: SHA256:bB1qbbqmDXZNT0KKD5c2Dfjg53JGhj7B3CFcLIzSqq8

View file

@ -699,7 +699,7 @@ impl<BorrowType: marker::BorrowType, K, V> NodeRef<BorrowType, K, V> {
} }
} }
impl<'a, K, V> NodeRef<marker::Mut<'a>, K, V> { impl<'a, K: 'a, V: 'a> NodeRef<marker::Mut<'a>, K, V> {
pub(crate) fn grow_node(&mut self) { pub(crate) fn grow_node(&mut self) {
// grow the node // grow the node
let capacity = self.capacity(); let capacity = self.capacity();
@ -1573,6 +1573,11 @@ where
iter: None, iter: None,
} }
} }
pub fn set_once(&mut self, once: T) {
assert!(self.once.is_none());
self.once = Some(once);
}
} }
impl<K, V> Tree<K, V> impl<K, V> Tree<K, V>
@ -1635,7 +1640,7 @@ where
subtree.get_mut(key_seq) subtree.get_mut(key_seq)
} }
pub fn insert<'a>(&'a mut self, key_seq: impl Iterator<Item = K> + 'a, val: V) -> &mut V { pub fn insert<'a>(&'a mut self, key_seq: impl Iterator<Item = K> + 'a, val: V) -> &'a mut V {
let mut subtree = self.as_subtree_mut(); let mut subtree = self.as_subtree_mut();
let v = subtree.insert(key_seq, val); let v = subtree.insert(key_seq, val);
v v