Skip to content

Commit b44b5da

Browse files
author
Jorge Aparicio
committed
libregex_macros: use unboxed closures
1 parent 879ebce commit b44b5da

File tree

1 file changed

+5
-3
lines changed

1 file changed

+5
-3
lines changed

src/libregex_macros/lib.rs

Lines changed: 5 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -19,6 +19,7 @@
1919
html_root_url = "http://doc.rust-lang.org/nightly/")]
2020

2121
#![feature(plugin_registrar, quote)]
22+
#![feature(unboxed_closures)]
2223

2324
extern crate regex;
2425
extern crate syntax;
@@ -601,9 +602,10 @@ fn exec<'t>(which: ::regex::native::MatchKind, input: &'t str,
601602

602603
// Converts `xs` to a `[x1, x2, .., xN]` expression by calling `to_expr`
603604
// on each element in `xs`.
604-
fn vec_expr<T, It: Iterator<T>>(&self, xs: It,
605-
to_expr: |&ExtCtxt, T| -> P<ast::Expr>)
606-
-> P<ast::Expr> {
605+
fn vec_expr<T, It, F>(&self, xs: It, mut to_expr: F) -> P<ast::Expr> where
606+
It: Iterator<T>,
607+
F: FnMut(&ExtCtxt, T) -> P<ast::Expr>,
608+
{
607609
let exprs = xs.map(|x| to_expr(self.cx, x)).collect();
608610
self.cx.expr_vec(self.sp, exprs)
609611
}

0 commit comments

Comments
 (0)