about summary refs log tree commit diff
path: root/src/libstd/run.rs
diff options
context:
space:
mode:
authorKevin Ballard <kevin@sb.org>2013-08-06 22:34:22 -0700
committerCorey Richardson <corey@octayn.net>2013-08-07 22:41:09 -0400
commit8964fcc5ac9cefcc55ea071142c3c81d623a52be (patch)
tree4132b0ac9bc5396713071a4105ce29ecf003b2db /src/libstd/run.rs
parent8523f6d64355f53bb9453c2c9d32e835bec790ae (diff)
Implement DoubleEndedIterator on Range
Range is now invertable as long as its element type conforms to Integer.

Remove int::range_rev() et al in favor of range().invert().
Diffstat (limited to 'src/libstd/run.rs')
-rw-r--r--src/libstd/run.rs6
1 files changed, 2 insertions, 4 deletions
diff --git a/src/libstd/run.rs b/src/libstd/run.rs
index ef3d881c5fe..694aa672af7 100644
--- a/src/libstd/run.rs
+++ b/src/libstd/run.rs
@@ -632,7 +632,6 @@ fn spawn_process_os(prog: &str, args: &[~str],
 
     use libc::funcs::posix88::unistd::{fork, dup2, close, chdir, execvp};
     use libc::funcs::bsd44::getdtablesize;
-    use int;
 
     mod rustrt {
         use libc::c_void;
@@ -665,10 +664,9 @@ fn spawn_process_os(prog: &str, args: &[~str],
             fail!("failure in dup3(err_fd, 2): %s", os::last_os_error());
         }
         // close all other fds
-        do int::range_rev(getdtablesize() as int, 3) |fd| {
+        for fd in range(3, getdtablesize()).invert() {
             close(fd as c_int);
-            true
-        };
+        }
 
         do with_dirp(dir) |dirp| {
             if !dirp.is_null() && chdir(dirp) == -1 {