From b29cd22bce6325a60788ab84f989bd2e82fcaaf4 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Mon, 10 Jun 2013 00:34:23 +1000 Subject: std: replace str::all/any fns and methods with iterators --- src/libextra/json.rs | 2 +- src/libextra/semver.rs | 3 ++- 2 files changed, 3 insertions(+), 2 deletions(-) (limited to 'src/libextra') 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 { - 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) -- cgit 1.4.1-3-g733a5