diff --git a/src/mm.rs b/src/mm.rs index bb7b3d0..301ed55 100644 --- a/src/mm.rs +++ b/src/mm.rs @@ -33,6 +33,8 @@ use getopt::GetOpt; use strerror::StrError; use sysexits::{ EX_IOERR, EX_USAGE }; +use ArgMode::*; + enum ArgMode { In, Out } fn main() -> ExitCode { @@ -57,12 +59,12 @@ fn main() -> ExitCode { Ok("i") => { /* add inputs */ let input = opt.arg().unwrap(); ins.push(input); - mode = Some(ArgMode::In); + mode = Some(In); }, Ok("o") => { /* add output */ let output = opt.arg().unwrap(); outs.push(output); - mode = Some(ArgMode::Out); + mode = Some(Out); }, Err(_) | Ok(_) => { eprintln!("{}", usage); @@ -77,8 +79,8 @@ fn main() -> ExitCode { if let Some(m) = mode { for arg in remaining { match m { - ArgMode::In => ins.push(arg.to_string()), - ArgMode::Out => outs.push(arg.to_string()), + In => ins.push(arg.to_string()), + Out => outs.push(arg.to_string()), }; } }