diff --git a/src/base64/base64.rs b/src/base64/base64.rs index 817632bc4..e09b08c18 100644 --- a/src/base64/base64.rs +++ b/src/base64/base64.rs @@ -96,7 +96,7 @@ pub fn uumain(args: Vec) -> 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) }; diff --git a/src/common/c_types.rs b/src/common/c_types.rs index ae2580922..ea4818b7c 100644 --- a/src/common/c_types.rs +++ b/src/common/c_types.rs @@ -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; diff --git a/src/cp/cp.rs b/src/cp/cp.rs index 52dc096d3..4e3826c59 100644 --- a/src/cp/cp.rs +++ b/src/cp/cp.rs @@ -31,6 +31,8 @@ pub enum Mode { Version, } +impl Copy for Mode {} + pub fn uumain(args: Vec) -> int { let opts = [ optflag("h", "help", "display this help and exit"), diff --git a/src/fmt/linebreak.rs b/src/fmt/linebreak.rs index fc0214e56..f7f6b6c27 100644 --- a/src/fmt/linebreak.rs +++ b/src/fmt/linebreak.rs @@ -322,7 +322,7 @@ fn build_best_path<'a>(paths: &Vec>, active: &Vec) -> 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) => { diff --git a/src/hostid/hostid.rs b/src/hostid/hostid.rs index eeb899429..05dc6dabf 100644 --- a/src/hostid/hostid.rs +++ b/src/hostid/hostid.rs @@ -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; diff --git a/src/kill/kill.rs b/src/kill/kill.rs index 17a71f4c1..6ed91df25 100644 --- a/src/kill/kill.rs +++ b/src/kill/kill.rs @@ -52,6 +52,8 @@ pub enum Mode { Version, } +impl Copy for Mode {} + pub fn uumain(args: Vec) -> int { let opts = [ optflag("h", "help", "display this help and exit"), diff --git a/src/mv/mv.rs b/src/mv/mv.rs index 02e770e10..e3dabd008 100644 --- a/src/mv/mv.rs +++ b/src/mv/mv.rs @@ -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) -> int { let program = args[0].as_slice(); let opts = [ diff --git a/src/rm/rm.rs b/src/rm/rm.rs index 2433dcaee..f5d13030c 100644 --- a/src/rm/rm.rs +++ b/src/rm/rm.rs @@ -27,6 +27,8 @@ enum InteractiveMode { InteractiveAlways } +impl Copy for InteractiveMode {} + static NAME: &'static str = "rm"; pub fn uumain(args: Vec) -> int { diff --git a/src/test/test.rs b/src/test/test.rs index 97bb9bcf9..6db9d0787 100644 --- a/src/test/test.rs +++ b/src/test/test.rs @@ -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