Remove the now unnecessary conversion of os::args() ret val.

This commit is contained in:
Michael Gehring
2014-05-23 14:35:58 +02:00
parent 0ce3f0f4e1
commit 46b9d6d78e
15 changed files with 17 additions and 17 deletions
+1 -1
View File
@@ -36,7 +36,7 @@ mod util;
static NAME: &'static str = "base64";
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let opts = ~[
optflag("d", "decode", "decode data"),
optflag("i", "ignore-garbage", "when decoding, ignore non-alphabetic characters"),
+1 -1
View File
@@ -20,7 +20,7 @@ use std::io::stdio::{stdout_raw, stdin_raw};
use std::io::{BufferedWriter};
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let program = args.get(0).as_slice();
let opts = ~[
getopts::optflag("A", "show-all", "equivalent to -vET"),
+1 -1
View File
@@ -78,7 +78,7 @@ fn open_file(name: &str) -> IoResult<Box<Reader>> {
}
pub fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let opts = [
getopts::optflag("h", "help", "display this help and exit"),
getopts::optflag("V", "version", "output version information and exit"),
+1 -1
View File
@@ -88,7 +88,7 @@ fn open_file(name: &str) -> IoResult<Box<Buffer>> {
}
pub fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let opts = [
getopts::optflag("1", "", "suppress column 1 (lines uniq to FILE1)"),
getopts::optflag("2", "", "suppress column 2 (lines uniq to FILE2)"),
+1 -1
View File
@@ -32,7 +32,7 @@ pub enum Mode {
}
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let opts = ~[
optflag("h", "help", "display this help and exit"),
optflag("", "version", "output version information and exit"),
+1 -1
View File
@@ -17,7 +17,7 @@ use std::io::print;
static VERSION: &'static str = "1.0.0";
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let program = args.get(0).clone();
let opts = ~[
getopts::optflag("z", "zero", "separate output with NUL rather than newline"),
+1 -1
View File
@@ -91,7 +91,7 @@ fn du(path: &Path, mut my_stat: Stat,
}
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let program = args.get(0).as_slice();
let opts = ~[
// In task
+1 -1
View File
@@ -70,7 +70,7 @@ fn convert_str(string: &str, index: uint, base: uint) -> (char, int) {
}
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let program = args.get(0).clone();
let opts = ~[
getopts::optflag("n", "", "do not output the trailing newline"),
+2 -2
View File
@@ -28,9 +28,9 @@ static VERSION: &'static str = "1.0.0";
fn main() {
let (args, obs_width) = handle_obsolete(os::args().as_slice().to_owned());
let args = os::args();
let (args, obs_width) = handle_obsolete(args.as_slice());
let program = args.get(0).clone();
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let opts = [
getopts::optflag("b", "bytes", "count using bytes rather than columns (meaning control characters such as newline are not treated specially)"),
+1 -1
View File
@@ -26,7 +26,7 @@ use c_types::{get_pw_from_args, group};
static NAME: &'static str = "groups";
fn main () {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let options = [
optflag("h", "", "Help")
];
+1 -1
View File
@@ -31,7 +31,7 @@ fn main () {
(args, None) => args
};
let args: Vec<StrBuf> = options.iter().map(|x| x.to_strbuf()).collect();
let args = options;
let possible_options = [
optopt("n", "number", "Number of lines to print", "n"),
+2 -2
View File
@@ -24,8 +24,8 @@ extern {
}
fn main () {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let program = args.get(0).to_owned();
let args = os::args();
let program = args.get(0);
let options = [
optflag("f", "full", "Default option to show full name"),
+1 -1
View File
@@ -88,7 +88,7 @@ extern {
static NAME: &'static str = "id";
fn main () {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let args_t = args.tail();
let options = [
+1 -1
View File
@@ -54,7 +54,7 @@ pub enum Mode {
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let opts = ~[
optflag("h", "help", "display this help and exit"),
+1 -1
View File
@@ -44,7 +44,7 @@ fn version() {
}
fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let args = os::args();
let program = args.get(0).clone();
//