remove obsolete foreach keyword

this has been replaced by `for`
This commit is contained in:
Daniel Micay 2013-08-03 12:45:23 -04:00
parent 9f74217d80
commit 1008945528
298 changed files with 1569 additions and 1574 deletions

View file

@ -615,7 +615,7 @@ pub mod rt {
let headsize = match head { Some(_) => 1, _ => 0 };
let uwidth : uint = match cv.width {
CountImplied => {
foreach &c in head.iter() {
for &c in head.iter() {
buf.push_char(c);
}
return buf.push_str(s);
@ -624,7 +624,7 @@ pub mod rt {
};
let strlen = s.char_len() + headsize;
if uwidth <= strlen {
foreach &c in head.iter() {
for &c in head.iter() {
buf.push_char(c);
}
return buf.push_str(s);
@ -632,7 +632,7 @@ pub mod rt {
let mut padchar = ' ';
let diff = uwidth - strlen;
if have_flag(cv.flags, flag_left_justify) {
foreach &c in head.iter() {
for &c in head.iter() {
buf.push_char(c);
}
buf.push_str(s);
@ -666,7 +666,7 @@ pub mod rt {
// instead.
if signed && zero_padding {
foreach &head in head.iter() {
for &head in head.iter() {
if head == '+' || head == '-' || head == ' ' {
buf.push_char(head);
buf.push_str(padstr);
@ -676,7 +676,7 @@ pub mod rt {
}
}
buf.push_str(padstr);
foreach &c in head.iter() {
for &c in head.iter() {
buf.push_char(c);
}
buf.push_str(s);

View file

@ -456,13 +456,13 @@ mod tests {
let total = Exclusive::new(~0);
foreach _ in range(0u, num_tasks) {
for _ in range(0u, num_tasks) {
let total = total.clone();
let (port, chan) = comm::stream();
futures.push(port);
do task::spawn || {
foreach _ in range(0u, count) {
for _ in range(0u, count) {
do total.with |count| {
**count += 1;
}
@ -471,7 +471,7 @@ mod tests {
}
};
foreach f in futures.iter() { f.recv() }
for f in futures.iter() { f.recv() }
do total.with |total| {
assert!(**total == num_tasks * count)