We read every piece of feedback, and take your input very seriously.
To see all available qualifiers, see our documentation.
There was an error while loading. Please reload this page.
each_split_within
1 parent f56f972 commit 04652b5Copy full SHA for 04652b5
src/libgetopts/lib.rs
@@ -87,6 +87,7 @@
87
html_playground_url = "http://play.rust-lang.org/")]
88
#![feature(globs, phase)]
89
#![feature(import_shadowing)]
90
+#![feature(unboxed_closures)]
91
#![deny(missing_docs)]
92
93
#[cfg(test)] #[phase(plugin, link)] extern crate log;
@@ -867,8 +868,9 @@ impl Copy for LengthLimit {}
867
868
///
869
/// Panics during iteration if the string contains a non-whitespace
870
/// sequence longer than the limit.
-fn each_split_within<'a>(ss: &'a str, lim: uint, it: |&'a str| -> bool)
871
- -> bool {
+fn each_split_within<F>(ss: &str, lim: uint, mut it: F) -> bool where
872
+ F: FnMut(&str) -> bool
873
+{
874
// Just for fun, let's write this as a state machine:
875
876
let mut slice_start = 0;
0 commit comments