Skip to content

Commit 04652b5

Browse files
author
Jorge Aparicio
committed
libgetopts: use unboxed closures in each_split_within
1 parent f56f972 commit 04652b5

File tree

1 file changed

+4
-2
lines changed

1 file changed

+4
-2
lines changed

src/libgetopts/lib.rs

Lines changed: 4 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -87,6 +87,7 @@
8787
html_playground_url = "http://play.rust-lang.org/")]
8888
#![feature(globs, phase)]
8989
#![feature(import_shadowing)]
90+
#![feature(unboxed_closures)]
9091
#![deny(missing_docs)]
9192

9293
#[cfg(test)] #[phase(plugin, link)] extern crate log;
@@ -867,8 +868,9 @@ impl Copy for LengthLimit {}
867868
///
868869
/// Panics during iteration if the string contains a non-whitespace
869870
/// sequence longer than the limit.
870-
fn each_split_within<'a>(ss: &'a str, lim: uint, it: |&'a str| -> bool)
871-
-> bool {
871+
fn each_split_within<F>(ss: &str, lim: uint, mut it: F) -> bool where
872+
F: FnMut(&str) -> bool
873+
{
872874
// Just for fun, let's write this as a state machine:
873875

874876
let mut slice_start = 0;

0 commit comments

Comments
 (0)