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

@@ -135,7 +135,7 @@ fn test_opts(config: config) -> test::test_opts {
fn make_tests(config: config) -> [test::test_desc] {
#debug("making tests from %s", config.src_base);
let mut tests = [];
for file: str in os::list_dir_path(config.src_base) {
for os::list_dir_path(config.src_base).each {|file|
let file = file;
#debug("inspecting file %s", file);
if is_test(config, file) {
@@ -154,11 +154,11 @@ fn is_test(config: config, testfile: str) -> bool {
let mut valid = false;
for ext in valid_extensions {
for valid_extensions.each {|ext|
if str::ends_with(name, ext) { valid = true; }
}
for pre in invalid_prefixes {
for invalid_prefixes.each {|pre|
if str::starts_with(name, pre) { valid = false; }
}