diff options
| author | Marvin Löbel <loebel.marvin@gmail.com> | 2014-12-18 02:12:53 +0100 |
|---|---|---|
| committer | Marvin Löbel <loebel.marvin@gmail.com> | 2014-12-25 17:08:29 +0100 |
| commit | 72c8f3772bdca40ff2be2908aaf6b6a73d1c7821 (patch) | |
| tree | 4d3fd31002e58baeaf1be614a08cf2ef9a30733a /src/libunicode | |
| parent | ead198c5133fd649d1e385cfc46f344a2baaef8b (diff) | |
| download | rust-72c8f3772bdca40ff2be2908aaf6b6a73d1c7821.tar.gz rust-72c8f3772bdca40ff2be2908aaf6b6a73d1c7821.zip | |
Prepared most `StrExt` pattern using methods for stabilization
Made iterator-returning methods return newtypes Adjusted some docs to be forwards compatible with a generic pattern API
Diffstat (limited to 'src/libunicode')
| -rw-r--r-- | src/libunicode/u_str.rs | 9 |
1 files changed, 4 insertions, 5 deletions
diff --git a/src/libunicode/u_str.rs b/src/libunicode/u_str.rs index a3d4dd057d0..3b0cc1443f0 100644 --- a/src/libunicode/u_str.rs +++ b/src/libunicode/u_str.rs @@ -24,16 +24,15 @@ use core::iter::{Filter, AdditiveIterator}; use core::mem; use core::num::Int; use core::slice; -use core::str::CharSplits; +use core::str::Split; use u_char::UnicodeChar; use tables::grapheme::GraphemeCat; /// An iterator over the words of a string, separated by a sequence of whitespace -/// FIXME: This should be opaque #[stable] pub struct Words<'a> { - inner: Filter<&'a str, CharSplits<'a, fn(char) -> bool>, fn(&&str) -> bool>, + inner: Filter<&'a str, Split<'a, fn(char) -> bool>, fn(&&str) -> bool>, } /// Methods for Unicode string slices @@ -90,12 +89,12 @@ impl UnicodeStr for str { #[inline] fn trim_left(&self) -> &str { - self.trim_left_chars(|&: c: char| c.is_whitespace()) + self.trim_left_matches(|&: c: char| c.is_whitespace()) } #[inline] fn trim_right(&self) -> &str { - self.trim_right_chars(|&: c: char| c.is_whitespace()) + self.trim_right_matches(|&: c: char| c.is_whitespace()) } } |
