mirror of
https://github.com/uutils/coreutils
synced 2024-11-15 01:17:09 +00:00
Merge pull request #74 from Arcterus/rm
rm: make InteractiveMode derive Eq
This commit is contained in:
commit
752716c851
1 changed files with 1 additions and 15 deletions
16
rm/rm.rs
16
rm/rm.rs
|
@ -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();
|
||||
|
|
Loading…
Reference in a new issue