Skip to content

Commit e66ba15

Browse files
author
Jorge Aparicio
committed
libunicode: fix fallout
1 parent 801ae13 commit e66ba15

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

src/libunicode/u_str.rs

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -29,8 +29,7 @@ use tables::grapheme::GraphemeCat;
2929

3030
/// An iterator over the words of a string, separated by a sequence of whitespace
3131
/// FIXME: This should be opaque
32-
pub type Words<'a> =
33-
Filter<'a, &'a str, CharSplits<'a, |char|:'a -> bool>>;
32+
pub type Words<'a> = Filter<&'a str, CharSplits<'a, |char|:'a -> bool>, fn(&&str) -> bool>;
3433

3534
/// Methods for Unicode string slices
3635
pub trait UnicodeStrPrelude for Sized? {
@@ -143,8 +142,9 @@ impl UnicodeStrPrelude for str {
143142

144143
#[inline]
145144
fn words(&self) -> Words {
145+
fn is_not_empty(s: &&str) -> bool { !s.is_empty() }
146146
let f = |c: char| c.is_whitespace();
147-
self.split(f).filter(|s| !s.is_empty())
147+
self.split(f).filter(is_not_empty)
148148
}
149149

150150
#[inline]

0 commit comments

Comments
 (0)