Removed all remaining unwrap() and expect() functions from main.rs

They now make use of the messages.rs error messages.
This commit is contained in:
2018-07-27 23:43:24 +02:00
parent 1e7907358f
commit 6e05947498
2 changed files with 29 additions and 10 deletions

View File

@@ -18,15 +18,18 @@ macro_rules! warning {
#[macro_export]
macro_rules! error {
($($arg:tt)*) => {
eprintln!("{:7}{}", "Error".on_red().white(), format_args!($($arg)*));
process::exit(0);
{
eprintln!("{:7}{}", "Error".on_red().white(), format_args!($($arg)*));
println!("");
process::exit(0);
}
};
}
pub fn welcome(string: &str) {
println!("{}", "".repeat(string.len() + 2));
println!("{text:^-width$}", text = string, width = string.len() + 2);
println!("{}", "".repeat(string.len() + 2));
println!("{}", "".repeat(string.len() + 20));
println!("{text:^-width$}", text = string, width = string.len() + 20);
println!("{}", "".repeat(string.len() + 20));
}
pub fn goodbye() {