std: Change Times trait to use do instead of for
Change the former repetition::
for 5.times { }
to::
do 5.times { }
.times() cannot be broken with `break` or `return` anymore; for those
cases, use a numerical range loop instead.
This commit is contained in:
@@ -1828,7 +1828,7 @@ impl<'self> StrSlice<'self> for &'self str {
|
||||
do ret.as_mut_buf |rbuf, _len| {
|
||||
let mut rbuf = rbuf;
|
||||
|
||||
for nn.times {
|
||||
do nn.times {
|
||||
ptr::copy_memory(rbuf, buf, len);
|
||||
rbuf = rbuf.offset(len as int);
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user