diff options
| author | Jorge Aparicio <japaricious@gmail.com> | 2015-01-31 20:03:04 -0500 |
|---|---|---|
| committer | Jorge Aparicio <japaricious@gmail.com> | 2015-02-02 13:40:18 -0500 |
| commit | fd702702ee90ddb47d207f8886818c7f91600713 (patch) | |
| tree | 7bed4a4d739e1372d9e101b350297e7946f17819 /src/libstd | |
| parent | d5f61b4332f3edd83c43f3f0d52d0381d7a6c37a (diff) | |
| download | rust-fd702702ee90ddb47d207f8886818c7f91600713.tar.gz rust-fd702702ee90ddb47d207f8886818c7f91600713.zip | |
`for x in xs.into_iter()` -> `for x in xs`
Also `for x in option.into_iter()` -> `if let Some(x) = option`
Diffstat (limited to 'src/libstd')
| -rw-r--r-- | src/libstd/old_io/fs.rs | 2 | ||||
| -rw-r--r-- | src/libstd/old_io/net/mod.rs | 2 | ||||
| -rw-r--r-- | src/libstd/rt/at_exit_imp.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sync/rwlock.rs | 2 | ||||
| -rw-r--r-- | src/libstd/sys/windows/process.rs | 2 |
5 files changed, 5 insertions, 5 deletions
diff --git a/src/libstd/old_io/fs.rs b/src/libstd/old_io/fs.rs index 142f723ef71..e1006f23996 100644 --- a/src/libstd/old_io/fs.rs +++ b/src/libstd/old_io/fs.rs @@ -649,7 +649,7 @@ pub fn rmdir_recursive(path: &Path) -> IoResult<()> { // delete all regular files in the way and push subdirs // on the stack - for child in children.into_iter() { + for child in children { // FIXME(#12795) we should use lstat in all cases let child_type = match cfg!(windows) { true => try!(update_err(stat(&child), path)), diff --git a/src/libstd/old_io/net/mod.rs b/src/libstd/old_io/net/mod.rs index d8394aa8b6a..bbe3a71dcc0 100644 --- a/src/libstd/old_io/net/mod.rs +++ b/src/libstd/old_io/net/mod.rs @@ -36,7 +36,7 @@ fn with_addresses<A, T, F>(addr: A, mut action: F) -> IoResult<T> where let addresses = try!(addr.to_socket_addr_all()); let mut err = DEFAULT_ERROR; - for addr in addresses.into_iter() { + for addr in addresses { match action(addr) { Ok(r) => return Ok(r), Err(e) => err = e diff --git a/src/libstd/rt/at_exit_imp.rs b/src/libstd/rt/at_exit_imp.rs index 5823f8453d8..3f15cf71ec3 100644 --- a/src/libstd/rt/at_exit_imp.rs +++ b/src/libstd/rt/at_exit_imp.rs @@ -58,7 +58,7 @@ pub fn cleanup() { // If we never called init, not need to cleanup! if queue as uint != 0 { let queue: Box<Queue> = mem::transmute(queue); - for to_run in queue.into_iter() { + for to_run in *queue { to_run.invoke(()); } } diff --git a/src/libstd/sync/rwlock.rs b/src/libstd/sync/rwlock.rs index 95b570dd9c8..2dfc708e15b 100644 --- a/src/libstd/sync/rwlock.rs +++ b/src/libstd/sync/rwlock.rs @@ -508,7 +508,7 @@ mod tests { } // Wait for children to pass their asserts - for r in children.into_iter() { + for r in children { assert!(r.join().is_ok()); } diff --git a/src/libstd/sys/windows/process.rs b/src/libstd/sys/windows/process.rs index a0a0c08ed09..58797111a20 100644 --- a/src/libstd/sys/windows/process.rs +++ b/src/libstd/sys/windows/process.rs @@ -147,7 +147,7 @@ impl Process { // Split the value and test each path to see if the // program exists. - for path in os::split_paths(v.container_as_bytes()).into_iter() { + for path in os::split_paths(v.container_as_bytes()) { let path = path.join(cfg.program().as_bytes()) .with_extension(os::consts::EXE_EXTENSION); if path.exists() { |
