diff options
Diffstat (limited to 'src/main.rs')
| -rw-r--r-- | src/main.rs | 13 |
1 files changed, 5 insertions, 8 deletions
diff --git a/src/main.rs b/src/main.rs index 6c529ed..ae36289 100644 --- a/src/main.rs +++ b/src/main.rs @@ -22,9 +22,9 @@ fn main() -> Result<()> { result } else { match result { - Ok(_) => Ok(()), + Ok(()) => Ok(()), Err(e) => { - eprintln!("{}", e); + eprintln!("{e}"); std::process::exit(1); } } @@ -44,19 +44,16 @@ fn run() -> Result<()> { let command_chain: Vec<Box<dyn Command>> = before_commands .into_iter() .chain(once(main_command)) - .chain(after_commands.into_iter()) + .chain(after_commands) .collect(); for command in command_chain { - let result = command.execute(arguments.get(2), &configuration, command_name); - if let Err(_) = result { - return result; - } + command.execute(arguments.get(2), &configuration, command_name)?; } return Ok(()); } } - Help::new().execute(None, &configuration, &"help".to_string()) + Help::new().execute(None, &configuration, "help") } |