Convert old-style for loops to new-style

Most could use the each method, but because of the hack used to
disambiguate old- and new-style loops, some had to use vec::each.

(This hack will go away soon.)

Issue #1619
This commit is contained in:
Marijn Haverbeke
2012-04-06 20:01:43 +02:00
parent 9c88e5ef5a
commit c902eafa14
99 changed files with 623 additions and 625 deletions

View File

@@ -328,7 +328,7 @@ fn write_mod_contents(
write_index(ctxt, option::get(doc.index));
}
for itemtag in doc.items {
for doc.items.each {|itemtag|
write_item(ctxt, itemtag);
}
}
@@ -381,7 +381,7 @@ fn write_index(ctxt: ctxt, index: doc::index) {
ret;
}
for entry in index.entries {
for index.entries.each {|entry|
let header = header_text_(entry.kind, entry.name);
let id = entry.link;
if option::is_some(entry.brief) {
@@ -431,7 +431,7 @@ fn write_nmod(ctxt: ctxt, doc: doc::nmoddoc) {
write_index(ctxt, option::get(doc.index));
}
for fndoc in doc.fns {
for doc.fns.each {|fndoc|
write_item_header(ctxt, doc::fntag(fndoc));
write_fn(ctxt, fndoc);
}