Skip to content

Commit 28949d9

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 164744 b: refs/heads/try c: 50ef207 h: refs/heads/master v: v3
1 parent 4fa8efe commit 28949d9

File tree

3 files changed

+8
-6
lines changed

3 files changed

+8
-6
lines changed

[refs]

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -2,7 +2,7 @@
22
refs/heads/master: f8f2c7a9537c7f333b242f616aefb75a83860927
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
44
refs/heads/snap-stage3: 8443b09e361b96d1f9b7f45a65ed0d31c0e86e70
5-
refs/heads/try: d3f5c1397c5012ce9bb022c0320c958c9fdc1208
5+
refs/heads/try: 50ef20725395dcaa3226ee1bfb3f186bb8a2a794
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d
88
refs/tags/release-0.2: c870d2dffb391e14efb05aa27898f1f6333a9596

branches/try/src/libunicode/lib.rs

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -29,6 +29,7 @@
2929
html_playground_url = "http://play.rust-lang.org/")]
3030
#![no_std]
3131
#![feature(globs)]
32+
#![feature(unboxed_closures)]
3233

3334
extern crate core;
3435

branches/try/src/libunicode/u_str.rs

Lines changed: 6 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -29,7 +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> = Filter<&'a str, CharSplits<'a, |char|:'a -> bool>, fn(&&str) -> bool>;
32+
pub type Words<'a> = Filter<&'a str, CharSplits<'a, fn(char) -> bool>, fn(&&str) -> bool>;
3333

3434
/// Methods for Unicode string slices
3535
pub trait UnicodeStrPrelude for Sized? {
@@ -143,8 +143,9 @@ impl UnicodeStrPrelude for str {
143143
#[inline]
144144
fn words(&self) -> Words {
145145
fn is_not_empty(s: &&str) -> bool { !s.is_empty() }
146-
let f = |c: char| c.is_whitespace();
147-
self.split(f).filter(is_not_empty)
146+
fn is_whitespace(c: char) -> bool { c.is_whitespace() }
147+
148+
self.split(is_whitespace).filter(is_not_empty)
148149
}
149150

150151
#[inline]
@@ -165,12 +166,12 @@ impl UnicodeStrPrelude for str {
165166

166167
#[inline]
167168
fn trim_left(&self) -> &str {
168-
self.trim_left_chars(|c: char| c.is_whitespace())
169+
self.trim_left_chars(|&: c: char| c.is_whitespace())
169170
}
170171

171172
#[inline]
172173
fn trim_right(&self) -> &str {
173-
self.trim_right_chars(|c: char| c.is_whitespace())
174+
self.trim_right_chars(|&: c: char| c.is_whitespace())
174175
}
175176
}
176177

0 commit comments

Comments
 (0)