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

Merge pull request #74 from Arcterus/rm

rm: make InteractiveMode derive Eq
This commit is contained in:
Jordi Boggiano 2014-02-04 04:09:33 -08:00
commit 752716c851

View file

@ -15,27 +15,13 @@ use std::os;
use std::io::{print,stdin,stderr,stdio,fs,BufferedReader,io_error}; use std::io::{print,stdin,stderr,stdio,fs,BufferedReader,io_error};
use extra::getopts::groups; use extra::getopts::groups;
#[deriving(Eq)]
enum InteractiveMode { enum InteractiveMode {
InteractiveNone, InteractiveNone,
InteractiveOnce, InteractiveOnce,
InteractiveAlways InteractiveAlways
} }
impl Eq for InteractiveMode {
fn eq(&self, other: &InteractiveMode) -> bool {
match (*self, *other) {
(InteractiveNone, InteractiveNone) |
(InteractiveOnce, InteractiveOnce) |
(InteractiveAlways, InteractiveAlways) => true,
_ => false
}
}
fn ne(&self, other: &InteractiveMode) -> bool {
!self.eq(other)
}
}
fn main() { fn main() {
let args = os::args(); let args = os::args();
let program = args[0].clone(); let program = args[0].clone();