Skip to content

Commit a862450

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163736 b: refs/heads/master c: e66ba15 h: refs/heads/master v: v3
1 parent a332616 commit a862450

File tree

2 files changed

+4
-4
lines changed

2 files changed

+4
-4
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -1,5 +1,5 @@
11
---
2-
refs/heads/master: 801ae1333c05ab641ff08c14fee776c08f42cff8
2+
refs/heads/master: e66ba157643420c6a46f07c68e9b817a66a64b4f
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 8443b09e361b96d1f9b7f45a65ed0d31c0e86e70
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42

trunk/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)