mirror of
https://github.com/uutils/coreutils
synced 2024-11-15 17:28:03 +00:00
Remove the unnecessary conversion of os::args() ret val
Missed these in 46b9d6d78e
This commit is contained in:
parent
0d76dda994
commit
a70f858f12
21 changed files with 21 additions and 21 deletions
|
@ -50,7 +50,7 @@ extern {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
|
||||
let opts = [
|
||||
optflag("", "help", "display this help and exit"),
|
||||
|
|
|
@ -28,7 +28,7 @@ static NAME: &'static str = "md5sum";
|
|||
static VERSION: &'static str = "1.0.0";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
|
||||
let program = args.get(0).clone();
|
||||
|
||||
|
|
|
@ -29,7 +29,7 @@ static VERSION: &'static str = "1.0.0";
|
|||
* Handles option parsing
|
||||
*/
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
|
||||
let opts = ~[
|
||||
// Linux-specific options, not implemented
|
||||
|
|
|
@ -24,7 +24,7 @@ static NAME: &'static str = "paste";
|
|||
static VERSION: &'static str = "1.0.0";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
|
||||
let opts = ~[
|
||||
|
|
|
@ -25,7 +25,7 @@ mod util;
|
|||
static NAME: &'static str = "printenv";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
let opts = ~[
|
||||
getopts::optflag("0", "null", "end each output line with 0 byte rather than newline"),
|
||||
|
|
|
@ -24,7 +24,7 @@ static NAME: &'static str = "pwd";
|
|||
static VERSION: &'static str = "1.0.0";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
let opts = ~[
|
||||
getopts::optflag("", "help", "display this help and exit"),
|
||||
|
|
2
rm/rm.rs
2
rm/rm.rs
|
@ -30,7 +30,7 @@ enum InteractiveMode {
|
|||
static NAME: &'static str = "rm";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
|
||||
// TODO: make getopts support -R in addition to -r
|
||||
|
|
|
@ -23,7 +23,7 @@ mod util;
|
|||
static NAME: &'static str = "rmdir";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
|
||||
let opts = ~[
|
||||
|
|
|
@ -34,7 +34,7 @@ fn escape_sequences(s: &str) -> String {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let opts = ~[
|
||||
getopts::optopt("s", "separator", "Separator character (defaults to \\n)", ""),
|
||||
getopts::optopt("t", "terminator", "Terminator character (defaults to separator)", ""),
|
||||
|
|
|
@ -24,7 +24,7 @@ mod util;
|
|||
static NAME: &'static str = "sleep";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
|
||||
let opts = ~[
|
||||
|
|
|
@ -24,7 +24,7 @@ static NAME: &'static str = "tac";
|
|||
static VERSION: &'static str = "1.0.0";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
|
||||
let opts = ~[
|
||||
|
|
2
tr/tr.rs
2
tr/tr.rs
|
@ -147,7 +147,7 @@ fn usage(opts: &[OptGroup]) {
|
|||
}
|
||||
|
||||
pub fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let opts = [
|
||||
getopts::optflag("c", "complement", "use the complement of SET1"),
|
||||
getopts::optflag("C", "", "same as -c"),
|
||||
|
|
|
@ -47,7 +47,7 @@ enum TruncateMode {
|
|||
static NAME: &'static str = "truncate";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
|
||||
let opts = ~[
|
||||
|
|
|
@ -35,7 +35,7 @@ extern {
|
|||
static NAME: &'static str = "tty";
|
||||
|
||||
fn main () {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
|
||||
let options = [
|
||||
optflag("s", "silent", "print nothing, only return an exit status")
|
||||
|
|
|
@ -52,7 +52,7 @@ unsafe fn getuname() -> utsrust {
|
|||
static NAME: &'static str = "uname";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).as_slice();
|
||||
let opts = ~[
|
||||
getopts::optflag("h", "help", "display this help and exit"),
|
||||
|
|
|
@ -27,7 +27,7 @@ mod util;
|
|||
static NAME: &'static str = "unlink";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
let opts = ~[
|
||||
getopts::optflag("h", "help", "display this help and exit"),
|
||||
|
|
|
@ -48,7 +48,7 @@ extern {
|
|||
}
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
let opts = ~[
|
||||
getopts::optflag("v", "version", "output version information and exit"),
|
||||
|
|
|
@ -48,7 +48,7 @@ extern {
|
|||
static NAME: &'static str = "users";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).as_slice();
|
||||
let opts = ~[
|
||||
getopts::optflag("h", "help", "display this help and exit"),
|
||||
|
|
2
wc/wc.rs
2
wc/wc.rs
|
@ -34,7 +34,7 @@ struct Result {
|
|||
static NAME: &'static str = "wc";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
let opts = ~[
|
||||
getopts::optflag("c", "bytes", "print the byte counts"),
|
||||
|
|
|
@ -42,7 +42,7 @@ unsafe fn getusername() -> String {
|
|||
static NAME: &'static str = "whoami";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).as_slice();
|
||||
let opts = ~[
|
||||
getopts::optflag("h", "help", "display this help and exit"),
|
||||
|
|
|
@ -25,7 +25,7 @@ mod util;
|
|||
static NAME: &'static str = "yes";
|
||||
|
||||
fn main() {
|
||||
let args: Vec<String> = os::args().iter().map(|x| x.to_strbuf()).collect();
|
||||
let args = os::args();
|
||||
let program = args.get(0).clone();
|
||||
let opts = ~[
|
||||
getopts::optflag("h", "help", "display this help and exit"),
|
||||
|
|
Loading…
Reference in a new issue