diff options
| author | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-09 23:10:50 +1000 |
|---|---|---|
| committer | Huon Wilson <dbau.pp+github@gmail.com> | 2013-06-10 23:02:54 +1000 |
| commit | 1e8982bdb26208d9d9ed4cdcbcd21cc9ef35bd46 (patch) | |
| tree | 54f03a318e14bcdbdb56e01b3c80d00a9db87a17 /src/libsyntax | |
| parent | 2ff6b298c5f23f48aa993fced41b6e29e446b7ce (diff) | |
| download | rust-1e8982bdb26208d9d9ed4cdcbcd21cc9ef35bd46.tar.gz rust-1e8982bdb26208d9d9ed4cdcbcd21cc9ef35bd46.zip | |
std: replace str::each_split* with an iterator
Diffstat (limited to 'src/libsyntax')
| -rw-r--r-- | src/libsyntax/parse/parser.rs | 11 |
1 files changed, 5 insertions, 6 deletions
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)); } } } |
