This commit is contained in:
2024-04-03 01:26:56 +02:00
parent bf7bd86934
commit 9a8568d692
9 changed files with 462 additions and 55 deletions

View File

@@ -26,7 +26,7 @@ pub fn rev_to_int(rev: &str) -> u16 {
}
pub fn fatal_error(error: &str) {
println!("\n\n{}:\n{}", "Error".bright_red(), error);
crate::println_error!("{}: {}", "Error".bright_red(), error);
stdin();
std::process::exit(1);
}
@@ -56,3 +56,19 @@ pub fn pb_style_download(pb: &ProgressBar, state: bool) {
pub fn cute_path(path: &Path) -> String {
path.to_str().unwrap().replace('\\', "/")
}
#[macro_export]
macro_rules! println_info {
($($arg:tt)*) => {{
println!($($arg)*);
info!($($arg)*);
}}
}
#[macro_export]
macro_rules! println_error {
($($arg:tt)*) => {{
eprintln!($($arg)*);
error!($($arg)*);
}}
}