std: replace str::all/any fns and methods with iterators
This commit is contained in:
parent
1e8982bdb2
commit
b29cd22bce
10 changed files with 15 additions and 60 deletions
|
|
@ -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 {
|
||||
|
|
|
|||
|
|
@ -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)
|
||||
|
|
|
|||
Loading…
Add table
Add a link
Reference in a new issue