diff --git a/deps/Cargo.toml b/deps/Cargo.toml index a2a004a85..4362ed8e2 100644 --- a/deps/Cargo.toml +++ b/deps/Cargo.toml @@ -6,12 +6,12 @@ version = "0.0.0" name = "null" [dependencies] -libc = "0.1.7" +libc = "0.1.8" getopts = "0.2.11" num_cpus = "*" rand = "0.3.8" -regex = "0.1.33" +regex = "0.1.38" rust-crypto = "0.2.31" -rustc-serialize = "0.3.13" -time = "0.1.25" +rustc-serialize = "0.3.15" +time = "0.1.26" unicode-width = "0.1.1" diff --git a/src/chmod/chmod.rs b/src/chmod/chmod.rs index 8f6c1daea..269093d2d 100644 --- a/src/chmod/chmod.rs +++ b/src/chmod/chmod.rs @@ -12,8 +12,10 @@ #![allow(unused_variables)] // only necessary while the TODOs still exist +extern crate aho_corasick; extern crate getopts; extern crate libc; +extern crate memchr; extern crate regex; extern crate regex_syntax; diff --git a/src/chmod/deps.mk b/src/chmod/deps.mk index 698054a2e..78a05f8b6 100644 --- a/src/chmod/deps.mk +++ b/src/chmod/deps.mk @@ -1 +1 @@ -DEPLIBS += regex regex-syntax +DEPLIBS += aho-corasick memchr regex regex-syntax diff --git a/src/cut/cut.rs b/src/cut/cut.rs index 723802725..5ced084a7 100644 --- a/src/cut/cut.rs +++ b/src/cut/cut.rs @@ -1,5 +1,5 @@ #![crate_name = "cut"] -#![feature(collections, path_ext)] +#![feature(path_ext, slice_position_elem)] /* * This file is part of the uutils coreutils package. diff --git a/src/du/du.rs b/src/du/du.rs index ddea33d5c..ca8072ed9 100644 --- a/src/du/du.rs +++ b/src/du/du.rs @@ -1,5 +1,5 @@ #![crate_name = "du"] -#![feature(fs_time, metadata_ext, std_misc)] +#![feature(future)] /* * This file is part of the uutils coreutils package. @@ -57,11 +57,11 @@ impl Stat { path: path.clone(), is_dir: metadata.is_dir(), size: metadata.len(), - blocks: metadata.as_raw().blocks() as u64, - nlink: metadata.as_raw().nlink() as u64, - created: metadata.modified(), - accessed: metadata.accessed(), - modified: metadata.modified() + blocks: metadata.blocks() as u64, + nlink: metadata.nlink() as u64, + created: metadata.mtime() as u64, + accessed: metadata.atime() as u64, + modified: metadata.mtime() as u64 } } } diff --git a/src/fmt/fmt.rs b/src/fmt/fmt.rs index 19a6b4a84..a665ae7b4 100644 --- a/src/fmt/fmt.rs +++ b/src/fmt/fmt.rs @@ -1,5 +1,5 @@ #![crate_name = "fmt"] -#![feature(core, str_char, unicode)] +#![feature(iter_cmp, str_char, unicode)] /* * This file is part of `fmt` from the uutils coreutils package. diff --git a/src/fold/fold.rs b/src/fold/fold.rs index b69007081..f1920dc44 100644 --- a/src/fold/fold.rs +++ b/src/fold/fold.rs @@ -1,5 +1,5 @@ #![crate_name = "fold"] -#![feature(collections)] +#![feature(slice_chars)] /* * This file is part of the uutils coreutils package. diff --git a/src/hostname/hostname.rs b/src/hostname/hostname.rs index 18f330bc8..a890549cd 100644 --- a/src/hostname/hostname.rs +++ b/src/hostname/hostname.rs @@ -1,5 +1,5 @@ #![crate_name = "hostname"] -#![feature(collections)] +#![feature(slice_extras)] /* * This file is part of the uutils coreutils package. diff --git a/src/mv/mv.rs b/src/mv/mv.rs index 607edf7c0..cabb0ec0a 100644 --- a/src/mv/mv.rs +++ b/src/mv/mv.rs @@ -1,5 +1,5 @@ #![crate_name = "mv"] -#![feature(collections, fs_time, path_ext, slice_patterns, str_char)] +#![feature(path_ext, slice_extras, slice_patterns, str_char)] #![allow(deprecated)] /* @@ -17,6 +17,7 @@ extern crate libc; use std::fs::{self, PathExt}; use std::io::{BufRead, BufReader, Result, stdin, Write}; +use std::os::unix::fs::MetadataExt; use std::path::PathBuf; #[path = "../common/util.rs"] @@ -287,7 +288,7 @@ fn rename(from: &PathBuf, to: &PathBuf, b: &Behaviour) -> Result<()> { } if b.update { - if try!(fs::metadata(from)).modified() <= try!(fs::metadata(to)).modified() { + if try!(fs::metadata(from)).mtime() <= try!(fs::metadata(to)).mtime() { return Ok(()); } } diff --git a/src/nl/deps.mk b/src/nl/deps.mk index 698054a2e..78a05f8b6 100644 --- a/src/nl/deps.mk +++ b/src/nl/deps.mk @@ -1 +1 @@ -DEPLIBS += regex regex-syntax +DEPLIBS += aho-corasick memchr regex regex-syntax diff --git a/src/nl/helper.rs b/src/nl/helper.rs index a24de9dd0..acec13470 100644 --- a/src/nl/helper.rs +++ b/src/nl/helper.rs @@ -11,11 +11,11 @@ fn parse_style(chars: &[char]) -> Result<::NumberingStyle, String> { let s: String = rest.iter().map(|c| *c).collect(); match regex::Regex::new(&s) { Ok(re) => Ok(::NumberingStyle::NumberForRegularExpression(re)), - Err(_) => Err(String::from_str("Illegal regular expression")), + Err(_) => Err(String::from("Illegal regular expression")), } } _ => { - Err(String::from_str("Illegal style encountered")) + Err(String::from("Illegal style encountered")) }, } } @@ -36,7 +36,7 @@ pub fn parse_options(settings: &mut ::Settings, opts: &getopts::Matches) -> Vec< "ln" => { settings.number_format = ::NumberFormat::Left; }, "rn" => { settings.number_format = ::NumberFormat::Right; }, "rz" => { settings.number_format = ::NumberFormat::RightZero; }, - _ => { errs.push(String::from_str("Illegal value for -n")); }, + _ => { errs.push(String::from("Illegal value for -n")); }, } } match opts.opt_str("b") { @@ -75,7 +75,7 @@ pub fn parse_options(settings: &mut ::Settings, opts: &getopts::Matches) -> Vec< let conv: Option = val.parse().ok(); match conv { None => { - errs.push(String::from_str("Illegal value for -i")); + errs.push(String::from("Illegal value for -i")); } Some(num) => { settings.line_increment = num } } @@ -87,7 +87,7 @@ pub fn parse_options(settings: &mut ::Settings, opts: &getopts::Matches) -> Vec< let conv: Option = val.parse().ok(); match conv { None => { - errs.push(String::from_str("Illegal value for -w")); + errs.push(String::from("Illegal value for -w")); } Some(num) => { settings.number_width = num } } @@ -99,7 +99,7 @@ pub fn parse_options(settings: &mut ::Settings, opts: &getopts::Matches) -> Vec< let conv: Option = val.parse().ok(); match conv { None => { - errs.push(String::from_str("Illegal value for -v")); + errs.push(String::from("Illegal value for -v")); } Some(num) => { settings.starting_line_number = num } } @@ -111,7 +111,7 @@ pub fn parse_options(settings: &mut ::Settings, opts: &getopts::Matches) -> Vec< let conv: Option = val.parse().ok(); match conv { None => { - errs.push(String::from_str("Illegal value for -l")); + errs.push(String::from("Illegal value for -l")); } Some(num) => { settings.join_blank_lines = num } } diff --git a/src/nl/nl.rs b/src/nl/nl.rs index a222d757d..f1f2fa6b6 100644 --- a/src/nl/nl.rs +++ b/src/nl/nl.rs @@ -1,5 +1,5 @@ #![crate_name = "nl"] -#![feature(collections, slice_patterns)] +#![feature(slice_patterns)] /* * This file is part of the uutils coreutils package. @@ -11,7 +11,9 @@ * */ +extern crate aho_corasick; extern crate getopts; +extern crate memchr; extern crate regex_syntax; extern crate regex; @@ -102,7 +104,7 @@ pub fn uumain(args: Vec) -> i32 { number_width: 6, number_format: NumberFormat::Right, renumber: true, - number_separator: String::from_str("\t"), + number_separator: String::from("\t"), }; let given_options = match opts.parse(&args[1..]) { diff --git a/src/ptx/deps.mk b/src/ptx/deps.mk index 698054a2e..78a05f8b6 100644 --- a/src/ptx/deps.mk +++ b/src/ptx/deps.mk @@ -1 +1 @@ -DEPLIBS += regex regex-syntax +DEPLIBS += aho-corasick memchr regex regex-syntax diff --git a/src/ptx/ptx.rs b/src/ptx/ptx.rs index 28204ffce..ca6bd0f99 100644 --- a/src/ptx/ptx.rs +++ b/src/ptx/ptx.rs @@ -1,5 +1,5 @@ #![crate_name = "ptx"] -#![feature(convert, collections)] +#![feature(convert, slice_chars, vec_push_all)] /* * This file is part of the uutils coreutils package. @@ -9,7 +9,10 @@ * For the full copyright and license information, please view the LICENSE * file that was distributed with this source code. */ + +extern crate aho_corasick; extern crate getopts; +extern crate memchr; extern crate regex_syntax; extern crate regex; diff --git a/src/readlink/readlink.rs b/src/readlink/readlink.rs index f5b09f21e..352800eb4 100644 --- a/src/readlink/readlink.rs +++ b/src/readlink/readlink.rs @@ -1,5 +1,4 @@ #![crate_name = "readlink"] -#![feature(file_type)] /* * This file is part of the uutils coreutils package. diff --git a/src/realpath/realpath.rs b/src/realpath/realpath.rs index 299e746d2..3d454edd2 100644 --- a/src/realpath/realpath.rs +++ b/src/realpath/realpath.rs @@ -1,5 +1,5 @@ #![crate_name= "realpath"] -#![feature(file_type, path_ext)] +#![feature(path_ext)] /* * This file is part of the uutils coreutils package. diff --git a/src/rm/rm.rs b/src/rm/rm.rs index ada5cf848..5a6b16b78 100644 --- a/src/rm/rm.rs +++ b/src/rm/rm.rs @@ -1,5 +1,5 @@ #![crate_name = "rm"] -#![feature(file_type, dir_entry_ext, path_ext)] +#![feature(path_ext)] /* * This file is part of the uutils coreutils package. diff --git a/src/split/deps.mk b/src/split/deps.mk index 40f6c5135..62b0140cc 100644 --- a/src/split/deps.mk +++ b/src/split/deps.mk @@ -1 +1 @@ -DEPLIBS += rand regex regex-syntax +DEPLIBS += aho-corasick memchr rand regex regex-syntax diff --git a/test/split.rs b/test/split.rs index 2af788078..6f533b5fc 100644 --- a/test/split.rs +++ b/test/split.rs @@ -1,4 +1,6 @@ extern crate libc; +extern crate memchr; +extern crate aho_corasick; extern crate rand; extern crate regex_syntax; extern crate regex;