From 04652b57e5b3a635c134fda670b82324ed6053e6 Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Sat, 6 Dec 2014 12:26:58 -0500 Subject: [PATCH] libgetopts: use unboxed closures in `each_split_within` --- src/libgetopts/lib.rs | 6 ++++-- 1 file changed, 4 insertions(+), 2 deletions(-) diff --git a/src/libgetopts/lib.rs b/src/libgetopts/lib.rs index a47fab124c3..79c435f01e4 100644 --- a/src/libgetopts/lib.rs +++ b/src/libgetopts/lib.rs @@ -87,6 +87,7 @@ html_playground_url = "http://play.rust-lang.org/")] #![feature(globs, phase)] #![feature(import_shadowing)] +#![feature(unboxed_closures)] #![deny(missing_docs)] #[cfg(test)] #[phase(plugin, link)] extern crate log; @@ -867,8 +868,9 @@ impl Copy for LengthLimit {} /// /// Panics during iteration if the string contains a non-whitespace /// sequence longer than the limit. -fn each_split_within<'a>(ss: &'a str, lim: uint, it: |&'a str| -> bool) - -> bool { +fn each_split_within(ss: &str, lim: uint, mut it: F) -> bool where + F: FnMut(&str) -> bool +{ // Just for fun, let's write this as a state machine: let mut slice_start = 0;