Skip to content

Commit 5430554

Browse files
committed
mbe: Remove Vec reference in container
1 parent b6aed79 commit 5430554

File tree

1 file changed

+2
-2
lines changed

1 file changed

+2
-2
lines changed

crates/mbe/src/expander/matcher.rs

+2-2
Original file line numberDiff line numberDiff line change
@@ -253,7 +253,7 @@ impl BindingsBuilder {
253253
&'a self,
254254
id: usize,
255255
len: usize,
256-
nested_refs: &mut Vec<&'a Vec<LinkNode<Rc<BindingKind>>>>,
256+
nested_refs: &mut Vec<&'a [LinkNode<Rc<BindingKind>>]>,
257257
) {
258258
self.nested[id].iter().take(len).for_each(|it| match it {
259259
LinkNode::Node(id) => nested_refs.push(&self.nodes[*id]),
@@ -263,7 +263,7 @@ impl BindingsBuilder {
263263

264264
fn collect_nested(&self, idx: usize, nested_idx: usize, nested: &mut Vec<Bindings>) {
265265
let last = &self.nodes[idx];
266-
let mut nested_refs = Vec::new();
266+
let mut nested_refs: Vec<&[_]> = Vec::new();
267267
self.nested[nested_idx].iter().for_each(|it| match *it {
268268
LinkNode::Node(idx) => nested_refs.push(&self.nodes[idx]),
269269
LinkNode::Parent { idx, len } => self.collect_nested_ref(idx, len, &mut nested_refs),

0 commit comments

Comments
 (0)