mirror of
https://github.com/uutils/coreutils
synced 2024-11-16 09:48:03 +00:00
Fix build with rust master
This commit is contained in:
parent
9aec1611df
commit
842cc8b14c
9 changed files with 24 additions and 2 deletions
|
@ -96,7 +96,7 @@ pub fn uumain(args: Vec<String>) -> int {
|
|||
}
|
||||
|
||||
fn decode(input: &mut Reader, ignore_garbage: bool) {
|
||||
let mut to_decode = match input.read_to_string() {
|
||||
let to_decode = match input.read_to_string() {
|
||||
Ok(m) => m,
|
||||
Err(f) => panic!(f)
|
||||
};
|
||||
|
|
|
@ -47,6 +47,8 @@ pub struct c_passwd {
|
|||
pub pw_shell: *const c_char,
|
||||
}
|
||||
|
||||
impl Copy for c_passwd {}
|
||||
|
||||
#[cfg(any(target_os = "macos", target_os = "freebsd"))]
|
||||
#[repr(C)]
|
||||
pub struct utsname {
|
||||
|
@ -68,6 +70,8 @@ pub struct utsname {
|
|||
pub domainame: [c_char, ..65]
|
||||
}
|
||||
|
||||
impl Copy for utsname {}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct c_group {
|
||||
pub gr_name: *const c_char, // group name
|
||||
|
@ -76,6 +80,8 @@ pub struct c_group {
|
|||
pub gr_mem: *const *const c_char, // member list
|
||||
}
|
||||
|
||||
impl Copy for c_group {}
|
||||
|
||||
#[repr(C)]
|
||||
pub struct c_tm {
|
||||
pub tm_sec: c_int, /* seconds */
|
||||
|
@ -89,6 +95,8 @@ pub struct c_tm {
|
|||
pub tm_isdst: c_int /* daylight saving time */
|
||||
}
|
||||
|
||||
impl Copy for c_tm {}
|
||||
|
||||
extern {
|
||||
pub fn getpwuid(uid: uid_t) -> *const c_passwd;
|
||||
pub fn getpwnam(login: *const c_char) -> *const c_passwd;
|
||||
|
|
|
@ -31,6 +31,8 @@ pub enum Mode {
|
|||
Version,
|
||||
}
|
||||
|
||||
impl Copy for Mode {}
|
||||
|
||||
pub fn uumain(args: Vec<String>) -> int {
|
||||
let opts = [
|
||||
optflag("h", "help", "display this help and exit"),
|
||||
|
|
|
@ -322,7 +322,7 @@ fn build_best_path<'a>(paths: &Vec<LineBreak<'a>>, active: &Vec<uint>) -> Vec<(&
|
|||
// now, chase the pointers back through the break list, recording
|
||||
// the words at which we should break
|
||||
loop {
|
||||
let next_best = paths[best_idx];
|
||||
let ref next_best = paths[best_idx];
|
||||
match next_best.linebreak {
|
||||
None => return breakwords,
|
||||
Some(prev) => {
|
||||
|
|
|
@ -42,6 +42,8 @@ pub enum Mode {
|
|||
Version,
|
||||
}
|
||||
|
||||
impl Copy for Mode {}
|
||||
|
||||
//currently rust libc interface doesn't include gethostid
|
||||
extern {
|
||||
pub fn gethostid() -> c_long;
|
||||
|
|
|
@ -52,6 +52,8 @@ pub enum Mode {
|
|||
Version,
|
||||
}
|
||||
|
||||
impl Copy for Mode {}
|
||||
|
||||
pub fn uumain(args: Vec<String>) -> int {
|
||||
let opts = [
|
||||
optflag("h", "help", "display this help and exit"),
|
||||
|
|
|
@ -49,6 +49,8 @@ pub enum OverwriteMode {
|
|||
Force,
|
||||
}
|
||||
|
||||
impl Copy for OverwriteMode {}
|
||||
|
||||
#[deriving(Eq, PartialEq)]
|
||||
pub enum BackupMode {
|
||||
NoBackup,
|
||||
|
@ -57,6 +59,8 @@ pub enum BackupMode {
|
|||
ExistingBackup,
|
||||
}
|
||||
|
||||
impl Copy for BackupMode {}
|
||||
|
||||
pub fn uumain(args: Vec<String>) -> int {
|
||||
let program = args[0].as_slice();
|
||||
let opts = [
|
||||
|
|
|
@ -27,6 +27,8 @@ enum InteractiveMode {
|
|||
InteractiveAlways
|
||||
}
|
||||
|
||||
impl Copy for InteractiveMode {}
|
||||
|
||||
static NAME: &'static str = "rm";
|
||||
|
||||
pub fn uumain(args: Vec<String>) -> int {
|
||||
|
|
|
@ -199,6 +199,8 @@ enum Precedence {
|
|||
UnOp
|
||||
}
|
||||
|
||||
impl Copy for Precedence {}
|
||||
|
||||
fn parse_expr(mut args: &[&[u8]], error: &mut bool) -> bool {
|
||||
if args.len() == 0 {
|
||||
false
|
||||
|
|
Loading…
Reference in a new issue