From 1e8982bdb26208d9d9ed4cdcbcd21cc9ef35bd46 Mon Sep 17 00:00:00 2001 From: Huon Wilson Date: Sun, 9 Jun 2013 23:10:50 +1000 Subject: std: replace str::each_split* with an iterator --- src/libsyntax/parse/parser.rs | 11 +++++------ 1 file changed, 5 insertions(+), 6 deletions(-) (limited to 'src/libsyntax/parse') diff --git a/src/libsyntax/parse/parser.rs b/src/libsyntax/parse/parser.rs index 59db35201f1..3ff894c267b 100644 --- a/src/libsyntax/parse/parser.rs +++ b/src/libsyntax/parse/parser.rs @@ -92,6 +92,7 @@ use parse::{new_sub_parser_from_file, next_node_id, ParseSess}; use opt_vec; use opt_vec::OptVec; +use core::iterator::IteratorUtil; use core::either::Either; use core::either; use core::hashmap::HashSet; @@ -3981,17 +3982,15 @@ impl Parser { token::LIT_STR(s) => { self.bump(); let the_string = ident_to_str(&s); - let mut words = ~[]; - for str::each_word(*the_string) |s| { words.push(s) } let mut abis = AbiSet::empty(); - for words.each |word| { - match abi::lookup(*word) { + for the_string.word_iter().advance |word| { + match abi::lookup(word) { Some(abi) => { if abis.contains(abi) { self.span_err( *self.span, fmt!("ABI `%s` appears twice", - *word)); + word)); } else { abis.add(abi); } @@ -4006,7 +4005,7 @@ impl Parser { str::connect_slices( abi::all_names(), ", "), - *word)); + word)); } } } -- cgit 1.4.1-3-g733a5