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 extra::getopts::groups;
#[deriving(Eq)]
enum InteractiveMode {
InteractiveNone,
InteractiveOnce,
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() {
let args = os::args();
let program = args[0].clone();