mbe: Remove Vec reference in container

This commit is contained in:
Jonas Platte 2022-09-14 23:35:12 +02:00
parent b6aed7914d
commit 54305545a5
No known key found for this signature in database
GPG Key ID: 7D261D771D915378

View File

@ -253,7 +253,7 @@ fn collect_nested_ref<'a>(
&'a self,
id: usize,
len: usize,
nested_refs: &mut Vec<&'a Vec<LinkNode<Rc<BindingKind>>>>,
nested_refs: &mut Vec<&'a [LinkNode<Rc<BindingKind>>]>,
) {
self.nested[id].iter().take(len).for_each(|it| match it {
LinkNode::Node(id) => nested_refs.push(&self.nodes[*id]),
@ -263,7 +263,7 @@ fn collect_nested_ref<'a>(
fn collect_nested(&self, idx: usize, nested_idx: usize, nested: &mut Vec<Bindings>) {
let last = &self.nodes[idx];
let mut nested_refs = Vec::new();
let mut nested_refs: Vec<&[_]> = Vec::new();
self.nested[nested_idx].iter().for_each(|it| match *it {
LinkNode::Node(idx) => nested_refs.push(&self.nodes[idx]),
LinkNode::Parent { idx, len } => self.collect_nested_ref(idx, len, &mut nested_refs),