From e66ba157643420c6a46f07c68e9b817a66a64b4f Mon Sep 17 00:00:00 2001 From: Jorge Aparicio Date: Tue, 2 Dec 2014 17:53:02 -0500 Subject: [PATCH] libunicode: fix fallout --- src/libunicode/u_str.rs | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/src/libunicode/u_str.rs b/src/libunicode/u_str.rs index f3aaad549c9..33e4df3ca36 100644 --- a/src/libunicode/u_str.rs +++ b/src/libunicode/u_str.rs @@ -29,8 +29,7 @@ use tables::grapheme::GraphemeCat; /// An iterator over the words of a string, separated by a sequence of whitespace /// FIXME: This should be opaque -pub type Words<'a> = - Filter<'a, &'a str, CharSplits<'a, |char|:'a -> bool>>; +pub type Words<'a> = Filter<&'a str, CharSplits<'a, |char|:'a -> bool>, fn(&&str) -> bool>; /// Methods for Unicode string slices pub trait UnicodeStrPrelude for Sized? { @@ -143,8 +142,9 @@ impl UnicodeStrPrelude for str { #[inline] fn words(&self) -> Words { + fn is_not_empty(s: &&str) -> bool { !s.is_empty() } let f = |c: char| c.is_whitespace(); - self.split(f).filter(|s| !s.is_empty()) + self.split(f).filter(is_not_empty) } #[inline]