Skip to content

Commit

Permalink
style: make main more readable
Browse files Browse the repository at this point in the history
  • Loading branch information
MilesCranmer committed Apr 14, 2024
1 parent 9b0e61d commit c0e3092
Show file tree
Hide file tree
Showing 2 changed files with 9 additions and 2 deletions.
7 changes: 6 additions & 1 deletion src/main.rs
Original file line number Diff line number Diff line change
Expand Up @@ -21,7 +21,12 @@ fn main() -> ExitCode {
None => {}
}

if let Err(ref e) = rip2::run(cli, mode, &mut stream) {
////////////////////////////////////////////////////////////
// Main code ///////////////////////////////////////////////
let result = rip2::run(cli, mode, &mut stream);
////////////////////////////////////////////////////////////

if let Err(ref e) = result {
println!("Exception: {}", e);
return ExitCode::FAILURE;
}
Expand Down
4 changes: 3 additions & 1 deletion tests/unit_tests.rs
Original file line number Diff line number Diff line change
Expand Up @@ -175,7 +175,9 @@ fn test_completions(
assert!(result.is_err());
let err_msg = result.unwrap_err().to_string();
assert!(err_msg.contains("Invalid shell specification: fake"));
assert!(err_msg.contains("Available shells: bash, elvish, fish, powershell, zsh, nushell"));
assert!(
err_msg.contains("Available shells: bash, elvish, fish, powershell, zsh, nushell")
);
}
_ => {}
}
Expand Down

0 comments on commit c0e3092

Please sign in to comment.