# HG changeset patch # User Nathan Goldbaum # Date 1562768557 14400 # Wed Jul 10 10:22:37 2019 -0400 # Node ID 542c0b49bd891f2929e8791e0507b1051d1dd5b5 # Parent d1466ca0f1dd11f2e44f87cc2fea28e9a62d260d simplify main function diff --git a/src/main.rs b/src/main.rs --- a/src/main.rs +++ b/src/main.rs @@ -7,14 +7,12 @@ mod revlogs; fn main() { - match options::Rug::from_args() { - options::Rug::Log {} => match commands::hg_log() { - Ok(_) => {} - Err(e) => println!("{}", e), - }, - options::Rug::Status {} => match commands::hg_status() { - Ok(_) => {} - Err(e) => println!("{}", e), - }, + let res = match options::Rug::from_args() { + options::Rug::Log {} => commands::hg_log(), + options::Rug::Status {} => commands::hg_status(), + }; + match res { + Ok(_) => {} + Err(e) => println!("{}", e), } }