From 234acad404535868ecd7f5b48c3e120c4ea559c9 Mon Sep 17 00:00:00 2001 From: Daniel Micay Date: Thu, 1 Aug 2013 18:35:46 -0400 Subject: replace `range` with an external iterator --- src/libstd/rt/args.rs | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) (limited to 'src/libstd/rt/args.rs') diff --git a/src/libstd/rt/args.rs b/src/libstd/rt/args.rs index cd950471286..e701cb64fb6 100644 --- a/src/libstd/rt/args.rs +++ b/src/libstd/rt/args.rs @@ -53,11 +53,10 @@ pub fn clone() -> Option<~[~str]> { #[cfg(target_os = "android")] #[cfg(target_os = "freebsd")] mod imp { - use libc; use option::{Option, Some, None}; + use iterator::{Iterator, range}; use str; - use uint; use unstable::finally::Finally; use util; @@ -113,10 +112,10 @@ mod imp { // Copied from `os`. unsafe fn load_argc_and_argv(argc: int, argv: **u8) -> ~[~str] { let mut args = ~[]; - for uint::range(0, argc as uint) |i| { + foreach i in range(0u, argc as uint) { args.push(str::raw::from_c_str(*(argv as **libc::c_char).offset(i as int))); } - return args; + args } extern { -- cgit 1.4.1-3-g733a5