1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 19:47:45 +00:00

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

View file

@ -36,7 +36,7 @@ mod util;
static NAME: &'static str = "base64"; static NAME: &'static str = "base64";
fn main() { fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect(); let args = os::args();
let opts = ~[ let opts = ~[
optflag("d", "decode", "decode data"), optflag("d", "decode", "decode data"),
optflag("i", "ignore-garbage", "when decoding, ignore non-alphabetic characters"), optflag("i", "ignore-garbage", "when decoding, ignore non-alphabetic characters"),

View file

@ -20,7 +20,7 @@ use std::io::stdio::{stdout_raw, stdin_raw};
use std::io::{BufferedWriter}; use std::io::{BufferedWriter};
fn main() { 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 program = args.get(0).as_slice();
let opts = ~[ let opts = ~[
getopts::optflag("A", "show-all", "equivalent to -vET"), getopts::optflag("A", "show-all", "equivalent to -vET"),

View file

@ -78,7 +78,7 @@ fn open_file(name: &str) -> IoResult<Box<Reader>> {
} }
pub fn main() { pub fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect(); let args = os::args();
let opts = [ let opts = [
getopts::optflag("h", "help", "display this help and exit"), getopts::optflag("h", "help", "display this help and exit"),
getopts::optflag("V", "version", "output version information and exit"), getopts::optflag("V", "version", "output version information and exit"),

View file

@ -88,7 +88,7 @@ fn open_file(name: &str) -> IoResult<Box<Buffer>> {
} }
pub fn main() { pub fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect(); let args = os::args();
let opts = [ let opts = [
getopts::optflag("1", "", "suppress column 1 (lines uniq to FILE1)"), getopts::optflag("1", "", "suppress column 1 (lines uniq to FILE1)"),
getopts::optflag("2", "", "suppress column 2 (lines uniq to FILE2)"), getopts::optflag("2", "", "suppress column 2 (lines uniq to FILE2)"),

View file

@ -32,7 +32,7 @@ pub enum Mode {
} }
fn main() { fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect(); let args = os::args();
let opts = ~[ let opts = ~[
optflag("h", "help", "display this help and exit"), optflag("h", "help", "display this help and exit"),
optflag("", "version", "output version information and exit"), optflag("", "version", "output version information and exit"),

View file

@ -17,7 +17,7 @@ use std::io::print;
static VERSION: &'static str = "1.0.0"; static VERSION: &'static str = "1.0.0";
fn main() { 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 program = args.get(0).clone();
let opts = ~[ let opts = ~[
getopts::optflag("z", "zero", "separate output with NUL rather than newline"), getopts::optflag("z", "zero", "separate output with NUL rather than newline"),

View file

@ -91,7 +91,7 @@ fn du(path: &Path, mut my_stat: Stat,
} }
fn main() { 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 program = args.get(0).as_slice();
let opts = ~[ let opts = ~[
// In task // In task

View file

@ -70,7 +70,7 @@ fn convert_str(string: &str, index: uint, base: uint) -> (char, int) {
} }
fn main() { 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 program = args.get(0).clone();
let opts = ~[ let opts = ~[
getopts::optflag("n", "", "do not output the trailing newline"), getopts::optflag("n", "", "do not output the trailing newline"),

View file

@ -28,9 +28,9 @@ static VERSION: &'static str = "1.0.0";
fn main() { 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 program = args.get(0).clone();
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect();
let opts = [ let opts = [
getopts::optflag("b", "bytes", "count using bytes rather than columns (meaning control characters such as newline are not treated specially)"), getopts::optflag("b", "bytes", "count using bytes rather than columns (meaning control characters such as newline are not treated specially)"),

View file

@ -26,7 +26,7 @@ use c_types::{get_pw_from_args, group};
static NAME: &'static str = "groups"; static NAME: &'static str = "groups";
fn main () { fn main () {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect(); let args = os::args();
let options = [ let options = [
optflag("h", "", "Help") optflag("h", "", "Help")
]; ];

View file

@ -31,7 +31,7 @@ fn main () {
(args, None) => args (args, None) => args
}; };
let args: Vec<StrBuf> = options.iter().map(|x| x.to_strbuf()).collect(); let args = options;
let possible_options = [ let possible_options = [
optopt("n", "number", "Number of lines to print", "n"), optopt("n", "number", "Number of lines to print", "n"),

View file

@ -24,8 +24,8 @@ extern {
} }
fn main () { fn main () {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect(); let args = os::args();
let program = args.get(0).to_owned(); let program = args.get(0);
let options = [ let options = [
optflag("f", "full", "Default option to show full name"), optflag("f", "full", "Default option to show full name"),

View file

@ -88,7 +88,7 @@ extern {
static NAME: &'static str = "id"; static NAME: &'static str = "id";
fn main () { 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 args_t = args.tail();
let options = [ let options = [

View file

@ -54,7 +54,7 @@ pub enum Mode {
fn main() { fn main() {
let args: Vec<StrBuf> = os::args().iter().map(|x| x.to_strbuf()).collect(); let args = os::args();
let opts = ~[ let opts = ~[
optflag("h", "help", "display this help and exit"), optflag("h", "help", "display this help and exit"),

View file

@ -44,7 +44,7 @@ fn version() {
} }
fn main() { 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 program = args.get(0).clone();
// //