Skip to content

Commit 95d0763

Browse files
author
Jorge Aparicio
committed
libregex: use unboxed closures
1 parent 1c5aac2 commit 95d0763

File tree

1 file changed

+3
-2
lines changed

1 file changed

+3
-2
lines changed

src/libregex/parse.rs

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -888,8 +888,9 @@ impl<'a> Parser<'a> {
888888
// build_from combines all AST elements starting at 'from' in the
889889
// parser's stack using 'mk' to combine them. If any such element is not an
890890
// AST then it is popped off the stack and ignored.
891-
fn build_from(&mut self, from: uint, mk: |Ast, Ast| -> Ast)
892-
-> Result<Ast, Error> {
891+
fn build_from<F>(&mut self, from: uint, mut mk: F) -> Result<Ast, Error> where
892+
F: FnMut(Ast, Ast) -> Ast,
893+
{
893894
if from >= self.stack.len() {
894895
return self.err("Empty group or alternate not allowed.")
895896
}

0 commit comments

Comments
 (0)