diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-10 00:34:23 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-10 23:02:54 +1000 |
| commit | b29cd22bce6325a60788ab84f989bd2e82fcaaf4 (patch) | |
| tree | dfa42affe6369b9595b462b4ee15fdaf88ff8b3a /src/libextra | |
| parent | 1e8982bdb26208d9d9ed4cdcbcd21cc9ef35bd46 (diff) | |
| download | rust-b29cd22bce6325a60788ab84f989bd2e82fcaaf4.tar.gz rust-b29cd22bce6325a60788ab84f989bd2e82fcaaf4.zip | |
std: replace str::all/any fns and methods with iterators
Diffstat (limited to 'src/libextra')
| -rw-r--r-- | src/libextra/json.rs | 2 | ||||
| -rw-r--r-- | src/libextra/semver.rs | 3 |
2 files changed, 3 insertions, 2 deletions
diff --git a/src/libextra/json.rs b/src/libextra/json.rs index fc1597ffed4..30a2b5f8627 100644 --- a/src/libextra/json.rs +++ b/src/libextra/json.rs @@ -567,7 +567,7 @@ impl Parser { } fn parse_ident(&mut self, ident: &str, value: Json) -> Result<Json, Error> { - if str::all(ident, |c| c == self.next_char()) { + if ident.iter().all(|c| c == self.next_char()) { self.bump(); Ok(value) } else { diff --git a/src/libextra/semver.rs b/src/libextra/semver.rs index 494f0c8ea81..36ebd10ae17 100644 --- a/src/libextra/semver.rs +++ b/src/libextra/semver.rs @@ -14,6 +14,7 @@ use core::prelude::*; +use core::iterator::IteratorUtil; use core::char; use core::cmp; use core::io::{ReaderUtil}; @@ -168,7 +169,7 @@ fn take_num(rdr: @io::Reader, ch: char) -> (uint, char) { fn take_ident(rdr: @io::Reader, ch: char) -> (Identifier, char) { let (s,ch) = take_nonempty_prefix(rdr, ch, char::is_alphanumeric); - if s.all(char::is_digit) { + if s.iter().all(char::is_digit) { match uint::from_str(s) { None => { bad_parse::cond.raise(()); (Numeric(0), ch) }, Some(i) => (Numeric(i), ch) |
