diff --git a/src/base64/base64.rs b/src/base64/base64.rs index f75d70bda..09987361a 100644 --- a/src/base64/base64.rs +++ b/src/base64/base64.rs @@ -1,5 +1,5 @@ #![crate_name = "base64"] -#![feature(box_syntax, collections, rustc_private)] +#![feature(box_syntax, rustc_private)] /* * This file is part of the uutils coreutils package. @@ -48,7 +48,7 @@ pub fn uumain(args: Vec) -> i32 { optflag("h", "help", "display this help text and exit"), optflag("V", "version", "output version information and exit") ]; - let matches = match getopts(args.tail(), &opts) { + let matches = match getopts(&args[1..], &opts) { Ok(m) => m, Err(e) => { crash!(1, "error: {}", e); diff --git a/src/basename/basename.rs b/src/basename/basename.rs index b5f6be03c..1179c709c 100644 --- a/src/basename/basename.rs +++ b/src/basename/basename.rs @@ -1,5 +1,5 @@ #![crate_name = "basename"] -#![feature(collections, rustc_private)] +#![feature(rustc_private)] /* * This file is part of the uutils coreutils package. @@ -34,7 +34,7 @@ pub fn uumain(args: Vec) -> i32 { getopts::optflag("V", "version", "output version information and exit"), ]; - let matches = match getopts::getopts(args.tail(), &opts) { + let matches = match getopts::getopts(&args[1..], &opts) { Ok(m) => m, Err(f) => crash!(1, "Invalid options\n{}", f) }; diff --git a/src/cat/cat.rs b/src/cat/cat.rs index 27d22252f..dfea5d71c 100644 --- a/src/cat/cat.rs +++ b/src/cat/cat.rs @@ -1,7 +1,5 @@ #![crate_name = "cat"] -#![feature(collections, rustc_private)] - -#![feature(box_syntax, unsafe_destructor)] +#![feature(rustc_private, box_syntax, unsafe_destructor)] /* * This file is part of the uutils coreutils package. @@ -42,7 +40,7 @@ pub fn uumain(args: Vec) -> i32 { getopts::optflag("h", "help", "display this help and exit"), getopts::optflag("V", "version", "output version information and exit"), ]; - let matches = match getopts::getopts(args.tail(), &opts) { + let matches = match getopts::getopts(&args[1..], &opts) { Ok(m) => m, Err(f) => panic!("Invalid options\n{}", f) }; diff --git a/src/chroot/chroot.rs b/src/chroot/chroot.rs index 87c413ac7..e2bd6a926 100644 --- a/src/chroot/chroot.rs +++ b/src/chroot/chroot.rs @@ -1,5 +1,5 @@ #![crate_name = "chroot"] -#![feature(collections, rustc_private, path_ext)] +#![feature(rustc_private, path_ext)] /* * This file is part of the uutils coreutils package. @@ -57,7 +57,7 @@ pub fn uumain(args: Vec) -> i32 { optflag("V", "version", "Show program's version") ]; - let opts = match getopts(args.tail(), &options) { + let opts = match getopts(&args[1..], &options) { Ok(m) => m, Err(f) => { show_error!("{}", f); @@ -195,7 +195,7 @@ fn set_groups_from_str(groups: &str) { fn set_user(user: &str) { if !user.is_empty() { - let user_id = get_pw_from_args(&vec!(String::from_str(user))).unwrap().pw_uid; + let user_id = get_pw_from_args(&vec!(user.to_string())).unwrap().pw_uid; let err = unsafe { setuid(user_id as libc::uid_t) }; if err != 0 { crash!(1, "cannot set user to {}: {}", user, Error::last_os_error()) diff --git a/src/echo/echo.rs b/src/echo/echo.rs index ea9c53720..350b01faa 100644 --- a/src/echo/echo.rs +++ b/src/echo/echo.rs @@ -1,5 +1,5 @@ #![crate_name = "echo"] -#![feature(rustc_private, str_char)] +#![feature(rustc_private)] /* * This file is part of the uutils coreutils package. @@ -94,7 +94,7 @@ fn parse_options(args: Vec, options: &mut EchoOptions) -> Option options.escape = true, "-E" => options.escape = false, _ => { - if arg.len() > 1 && arg.char_at(0) == '-' { + if arg.len() > 1 && arg.chars().next().unwrap_or('_') == '-' { let mut newopts = options.clone(); for ch in arg.chars().skip(1) { match ch { diff --git a/src/fmt/fmt.rs b/src/fmt/fmt.rs index a20047278..7edae633f 100644 --- a/src/fmt/fmt.rs +++ b/src/fmt/fmt.rs @@ -1,4 +1,5 @@ #![crate_name = "fmt"] +#![feature(box_syntax,rustc_private,str_char,unicode,core)] /* * This file is part of `fmt` from the uutils coreutils package. @@ -9,9 +10,6 @@ * file that was distributed with this source code. */ -#![feature(box_syntax,core,rustc_private,collections,str_char,unicode)] - -extern crate core; extern crate getopts; extern crate rustc_unicode; extern crate unicode_width; @@ -87,7 +85,7 @@ pub fn uumain(args: Vec) -> i32 { getopts::optflag("h", "help", "Display this help message and exit.") ]; - let matches = match getopts::getopts(args.tail(), &opts[..]) { + let matches = match getopts::getopts(&args[1..], &opts[..]) { Ok(m) => m, Err(f) => crash!(1, "{}\nTry `{} --help' for more information.", f, args[0]) }; diff --git a/src/fmt/parasplit.rs b/src/fmt/parasplit.rs index 22c688585..155edf6c2 100644 --- a/src/fmt/parasplit.rs +++ b/src/fmt/parasplit.rs @@ -7,7 +7,7 @@ * file that was distributed with this source code. */ -use core::iter::Peekable; +use std::iter::Peekable; use std::io::{BufRead, Lines}; use std::slice::Iter; use std::str::CharRange; diff --git a/src/sync/sync.rs b/src/sync/sync.rs index 8b76b30ec..0c4ca4280 100644 --- a/src/sync/sync.rs +++ b/src/sync/sync.rs @@ -1,5 +1,5 @@ #![crate_name = "sync"] -#![feature(collections, rustc_private)] +#![feature(rustc_private)] /* * This file is part of the uutils coreutils package. @@ -148,7 +148,7 @@ pub fn uumain(args: Vec) -> i32 { optflag("V", "version", "output version information and exit") ]; - let matches = match getopts(args.tail(), &options) { + let matches = match getopts(&args[1..], &options) { Ok(m) => { m } _ => { help(program, &options); return 1 } };