From 6940ee02319762decee6cb473f7a717ae9f6b3cc Mon Sep 17 00:00:00 2001 From: Isaac Mills Date: Sun, 30 Jan 2022 10:02:10 -0500 Subject: [PATCH] Bettew ewwow handwing OwO *UwU* --- src/main.rs | 16 +++++++--------- 1 file changed, 7 insertions(+), 9 deletions(-) diff --git a/src/main.rs b/src/main.rs index 6c76552..6c4ddf7 100644 --- a/src/main.rs +++ b/src/main.rs @@ -93,10 +93,13 @@ macro_rules! app { }; } -fn main() { +fn main() -> Result<(), std::io::Error> { + std::panic::set_hook(Box::new(|info| { + app!().error(ErrorKind::DisplayHelp, info).exit(); + })); let matches = app!().get_matches(); - match UwUify::new( + UwUify::new( matches.value_of("text"), matches.value_of("infile"), matches.value_of("outfile"), @@ -106,13 +109,8 @@ fn main() { matches.value_of("stutters"), matches.is_present("random"), ) - .uwuify() - { - Ok(_) => (), - Err(err) => { - app!().error(ErrorKind::DisplayHelp, err).exit(); - } - } + .uwuify()?; + Ok(()) } fn is_between_zero_and_one(input: &str) -> Result<(), &'static str> {