Skip to content

Commit 9aa971f

Browse files
author
Jorge Aparicio
committed
---
yaml --- r: 163272 b: refs/heads/snap-stage3 c: 50ef207 h: refs/heads/master v: v3
1 parent c887429 commit 9aa971f

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
@@ -1,7 +1,7 @@
11
---
22
refs/heads/master: 9146a919b616e39e528e4d7100d16eef52f1f852
33
refs/heads/snap-stage1: e33de59e47c5076a89eadeb38f4934f58a3618a6
4-
refs/heads/snap-stage3: d3f5c1397c5012ce9bb022c0320c958c9fdc1208
4+
refs/heads/snap-stage3: 50ef20725395dcaa3226ee1bfb3f186bb8a2a794
55
refs/heads/try: 20cbbffeefc1f35e2ea63afce7b42fbd79611d42
66
refs/tags/release-0.1: 1f5c5126e96c79d22cb7862f75304136e204f105
77
refs/heads/dist-snap: ba4081a5a8573875fed17545846f6f6902c8ba8d

branches/snap-stage3/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/snap-stage3/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)