diff --git a/crates/mbe/src/expander/matcher.rs b/crates/mbe/src/expander/matcher.rs index c1aa14d6b7e..0d970504da4 100644 --- a/crates/mbe/src/expander/matcher.rs +++ b/crates/mbe/src/expander/matcher.rs @@ -203,12 +203,11 @@ fn push_default(&mut self, idx: &mut BindingsIdx) { } fn build(self, idx: &BindingsIdx) -> Bindings { - let mut bindings = Bindings::default(); - self.build_inner(&mut bindings, &self.nodes[idx.0]); - bindings + self.build_inner(&self.nodes[idx.0]) } - fn build_inner(&self, bindings: &mut Bindings, link_nodes: &[LinkNode>]) { + fn build_inner(&self, link_nodes: &[LinkNode>]) -> Bindings { + let mut bindings = Bindings::default(); let mut nodes = Vec::new(); self.collect_nodes(link_nodes, &mut nodes); @@ -246,6 +245,8 @@ fn build_inner(&self, bindings: &mut Bindings, link_nodes: &[LinkNode( @@ -270,8 +271,7 @@ fn collect_nested(&self, idx: usize, nested_idx: usize, nested: &mut Vec