@@ 94,16 94,10 @@ fn main() {
fn run(argv: Vec<String>) -> Result<(), failure::Error> {
let appcfg = AppConfig::new(&argv)?;
- match appcfg {
- AppConfig {
- action: Action::Get,
- ..
- } => get_brightness(appcfg),
- AppConfig {
- action: Action::Watch,
- ..
- } => watch(appcfg),
- AppConfig { .. } => set_brightness(appcfg),
+ match appcfg.action {
+ Action::Get => get_brightness(appcfg),
+ Action::Watch => watch(appcfg),
+ Action::Set(_) | Action::Incr(_) | Action::Decr(_) => set_brightness(appcfg),
}
}