1
Fork 0
mirror of https://github.com/RGBCube/uutils-coreutils synced 2025-07-28 11:37:44 +00:00

Update for latest Rust

This commit is contained in:
Arcterus 2014-02-23 13:31:51 -08:00
parent 58128ef93f
commit b608664135
5 changed files with 22 additions and 20 deletions

View file

@ -11,16 +11,16 @@
#[feature(macro_rules)];
extern crate extra;
extern crate getopts;
extern crate sync;
extern crate time;
use std::os;
use std::io::fs;
use std::io::FileStat;
use std::option::Option;
use std::path::Path;
use extra::time::Timespec;
use time::Timespec;
use sync::{Arc, Future};
#[path = "../util.rs"]
@ -337,7 +337,7 @@ Try 'du --help' for more information.");
((time / 1000) as i64, (time % 1000 * 1000000) as i32)
};
let time_spec = Timespec::new(secs, nsecs);
extra::time::at(time_spec).strftime(time_format_str)
time::at(time_spec).strftime(time_format_str)
};
print!("{:<10} {:<30} {}", convert_size(size), time_str, stat.path.display());
} else {

12
env/env.rs vendored
View file

@ -11,6 +11,8 @@
/* last synced with: env (GNU coreutils) 8.13 */
#[allow(non_camel_case_types)];
struct options {
ignore_env: bool,
null: bool,
@ -188,9 +190,8 @@ fn main() {
std::os::setenv(name.as_slice(), val.as_slice())
}
match opts.program {
[ref prog, ..args] => {
match std::run::process_status(prog.as_slice(), args.as_slice()) {
if opts.program.len() >= 1 {
match std::run::process_status(opts.program[0].as_slice(), opts.program.slice_from(1)) {
Ok(exit) =>
std::os::set_exit_status(match exit {
std::io::process::ExitStatus(s) => s,
@ -198,11 +199,8 @@ fn main() {
}),
Err(_) => std::os::set_exit_status(1)
}
}
[] => {
} else {
// no program provided
print_env(opts.null);
}
}
}

View file

@ -13,6 +13,8 @@
* http://www.opensource.apple.com/source/shell_cmds/shell_cmds-118/id/id.c
*/
#[allow(non_camel_case_types)];
extern crate getopts;
use std::{libc, os, vec};
@ -41,7 +43,7 @@ struct c_group {
#[cfg(not(target_os = "linux"))]
mod audit {
pub use std::unstable::intrinsics::uninit;
pub use std::mem::uninit;
use std::libc::{uid_t, pid_t, c_int, c_uint, uint64_t, dev_t};
pub type au_id_t = uid_t;

View file

@ -12,7 +12,7 @@
/* last synced with: whoami (GNU coreutils) 8.22 */
// Allow dead code here in order to keep all fields, constants here, for consistency.
#[allow(dead_code)];
#[allow(dead_code, non_camel_case_types)];
#[feature(macro_rules, globs)];

View file

@ -11,6 +11,8 @@
/* last synced with: whoami (GNU coreutils) 8.21 */
#[allow(non_camel_case_types)];
#[feature(macro_rules)];
extern crate extra;