macros: Remove obsolete macros

Removes the `return_if_err!` and `safe_unwrap!` macros, which have now
been replaces by `crash_if_err!` throughout the whole code and thus
aren't used any longer.
This commit is contained in:
Andreas Hartmann 2021-08-23 12:02:11 +02:00 committed by Michael Debertol
parent 1755195251
commit 4fbb741314

View file

@ -99,24 +99,6 @@ macro_rules! crash_if_err(
//====
/// Unwraps the Result. Instead of panicking, it shows the error and then
/// returns from the function with the provided exit code.
/// Assumes the current function returns an i32 value.
#[macro_export]
macro_rules! return_if_err(
($exit_code:expr, $exp:expr) => (
match $exp {
Ok(m) => m,
Err(f) => {
$crate::show_error!("{}", f);
return $exit_code;
}
}
)
);
//====
#[macro_export]
macro_rules! safe_write(
($fd:expr, $($args:tt)+) => (
@ -137,18 +119,6 @@ macro_rules! safe_writeln(
)
);
/// Unwraps the Result. Instead of panicking, it exists the program with exit
/// code 1.
#[macro_export]
macro_rules! safe_unwrap(
($exp:expr) => (
match $exp {
Ok(m) => m,
Err(f) => $crate::crash!(1, "{}", f.to_string())
}
)
);
//-- message templates
//-- message templates : (join utility sub-macros)