Merge pull request #398 from ebfe/deprecation

This commit is contained in:
Alex Lyon 2014-09-23 16:08:02 -07:00
commit 66713ba4b4
7 changed files with 10 additions and 6 deletions

View file

@ -82,7 +82,7 @@ pub fn uumain(args: Vec<String>) -> int {
} }
fn handle_obsolete(args: &[String]) -> (Vec<String>, Option<String>) { fn handle_obsolete(args: &[String]) -> (Vec<String>, Option<String>) {
let mut args = Vec::<String>::from_slice(args); let mut args = args.to_vec();
let mut i = 0; let mut i = 0;
while i < args.len() { while i < args.len() {
if args[i].as_slice().char_at(0) == '-' && args[i].len() > 1 && args[i].as_slice().char_at(1).is_digit() { if args[i].as_slice().char_at(0) == '-' && args[i].len() > 1 && args[i].as_slice().char_at(1).is_digit() {

View file

@ -110,7 +110,7 @@ pub fn uumain(args: Vec<String>) -> int {
getopts::optflag("V", "version", "output version information and exit"), getopts::optflag("V", "version", "output version information and exit"),
); );
opts.push_all_move(get_algo_opts(binary_name.as_slice())); opts.extend(get_algo_opts(binary_name.as_slice()).into_iter());
let matches = match getopts::getopts(args.tail(), opts.as_slice()) { let matches = match getopts::getopts(args.tail(), opts.as_slice()) {
Ok(m) => m, Ok(m) => m,

View file

@ -133,7 +133,7 @@ pub fn uumain(args: Vec<String>) -> int {
// In case is found, the options vector will get rid of that object so that // In case is found, the options vector will get rid of that object so that
// getopts works correctly. // getopts works correctly.
fn obsolete(options: &[String]) -> (Vec<String>, Option<uint>) { fn obsolete(options: &[String]) -> (Vec<String>, Option<uint>) {
let mut options: Vec<String> = Vec::from_slice(options); let mut options: Vec<String> = options.to_vec();
let mut a = 0; let mut a = 0;
let b = options.len(); let b = options.len();

View file

@ -51,17 +51,20 @@ mod audit {
pub type au_emod_t = c_uint; pub type au_emod_t = c_uint;
pub type au_class_t = c_int; pub type au_class_t = c_int;
#[repr(C)]
pub struct au_mask { pub struct au_mask {
pub am_success: c_uint, pub am_success: c_uint,
pub am_failure: c_uint pub am_failure: c_uint
} }
pub type au_mask_t = au_mask; pub type au_mask_t = au_mask;
#[repr(C)]
pub struct au_tid_addr { pub struct au_tid_addr {
pub port: dev_t, pub port: dev_t,
} }
pub type au_tid_addr_t = au_tid_addr; pub type au_tid_addr_t = au_tid_addr;
#[repr(C)]
pub struct c_auditinfo_addr { pub struct c_auditinfo_addr {
pub ai_auid: au_id_t, /* Audit user ID */ pub ai_auid: au_id_t, /* Audit user ID */
pub ai_mask: au_mask_t, /* Audit masks. */ pub ai_mask: au_mask_t, /* Audit masks. */

View file

@ -65,7 +65,7 @@ fn parse_options(args: Vec<String>, options: &mut SeqOptions) -> Result<Vec<Stri
}, },
"-w" | "--widths" => options.widths = true, "-w" | "--widths" => options.widths = true,
"--" => { "--" => {
seq_args.push_all_move(iter.collect()); seq_args.extend(iter);
break; break;
}, },
_ => { _ => {

View file

@ -119,7 +119,7 @@ pub fn uumain(args: Vec<String>) -> int {
// In case is found, the options vector will get rid of that object so that // In case is found, the options vector will get rid of that object so that
// getopts works correctly. // getopts works correctly.
fn obsolete (options: &[String]) -> (Vec<String>, Option<uint>) { fn obsolete (options: &[String]) -> (Vec<String>, Option<uint>) {
let mut options: Vec<String> = Vec::from_slice(options); let mut options: Vec<String> = options.to_vec();
let mut a = 0; let mut a = 0;
let b = options.len(); let b = options.len();

View file

@ -59,7 +59,8 @@ fn options(args: &[String]) -> Result<Options, ()> {
let help = format!("{}\n\nUsage:\n {} {}\n\n{}\n{}", let help = format!("{}\n\nUsage:\n {} {}\n\n{}\n{}",
version, program, arguments, usage(brief, opts), version, program, arguments, usage(brief, opts),
comment); comment);
let names = m.free.clone().into_iter().collect::<Vec<String>>().append_one("-".to_string()); let mut names = m.free.clone().into_iter().collect::<Vec<String>>();
names.push("-".to_string());
let to_print = if m.opt_present("help") { Some(help) } let to_print = if m.opt_present("help") { Some(help) }
else if m.opt_present("version") { Some(version) } else if m.opt_present("version") { Some(version) }
else { None }; else { None };