From 50301e63ee1322ea61b0c4223590b019f4089806 Mon Sep 17 00:00:00 2001 From: Michael Gehring Date: Fri, 13 Feb 2015 20:57:47 +0100 Subject: [PATCH] env::args return Strings now --- mkmain.rs | 8 ++------ mkuutils.rs | 2 +- src/uutils/uutils.rs | 2 +- 3 files changed, 4 insertions(+), 8 deletions(-) diff --git a/mkmain.rs b/mkmain.rs index 7dd36fc0b..c4ad449a9 100644 --- a/mkmain.rs +++ b/mkmain.rs @@ -10,17 +10,13 @@ extern crate \"@UTIL_CRATE@\" as uu@UTIL_CRATE@; use std::env; use uu@UTIL_CRATE@::uumain; -fn args() -> Vec { - env::args().map(|a| a.into_string().unwrap()).collect() -} - fn main() { - env::set_exit_status(uumain(args())); + env::set_exit_status(uumain(env::args().collect())); } "; fn main() { - let args : Vec = env::args().map(|a| a.into_string().unwrap()).collect(); + let args : Vec = env::args().collect(); if args.len() != 3 { println!("usage: mkbuild "); env::set_exit_status(1); diff --git a/mkuutils.rs b/mkuutils.rs index a62a1a808..ad6d91493 100644 --- a/mkuutils.rs +++ b/mkuutils.rs @@ -5,7 +5,7 @@ use std::old_io::{File, Truncate, Write}; use std::old_path::Path; fn main() { - let args : Vec = env::args().map(|a| a.into_string().unwrap()).collect(); + let args : Vec = env::args().collect(); if args.len() < 3 { println!("usage: mkuutils "); env::set_exit_status(1); diff --git a/src/uutils/uutils.rs b/src/uutils/uutils.rs index e52a62b9d..eb328d4db 100644 --- a/src/uutils/uutils.rs +++ b/src/uutils/uutils.rs @@ -41,7 +41,7 @@ fn usage(cmap: &HashMap<&'static str, fn(Vec) -> i32>) { fn main() { let umap = util_map(); - let mut args : Vec = env::args().map(|a| a.into_string().unwrap()).collect(); + let mut args : Vec = env::args().collect(); // try binary name as util name. let binary = Path::new(args[0].as_slice());