From 95d0763707956ec6518694ec0fb8b82a7b3a1261 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sun, 7 Dec 2014 11:14:43 -0500 Subject: [PATCH] libregex: use unboxed closures --- src/libregex/parse.rs | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/src/libregex/parse.rs b/src/libregex/parse.rs index f7ea83a8a38..ccbd53c4f2a 100644 --- a/src/libregex/parse.rs +++ b/src/libregex/parse.rs @@ -888,8 +888,9 @@ impl<'a> Parser<'a> { // build_from combines all AST elements starting at 'from' in the // parser's stack using 'mk' to combine them. If any such element is not an // AST then it is popped off the stack and ignored. - fn build_from(&mut self, from: uint, mk: |Ast, Ast| -> Ast) - -> Result { + fn build_from(&mut self, from: uint, mut mk: F) -> Result where + F: FnMut(Ast, Ast) -> Ast, + { if from >= self.stack.len() { return self.err("Empty group or alternate not allowed.") }