mirror of
https://git.proxmox.com/git/proxmox
synced 2025-10-04 21:51:29 +00:00
lang: remove io_assert
Signed-off-by: Wolfgang Bumiller <w.bumiller@proxmox.com>
This commit is contained in:
parent
d4b4115400
commit
fc4e02a34f
@ -36,18 +36,3 @@ macro_rules! io_bail {
|
|||||||
return Err($crate::io_format_err!($($msg)+));
|
return Err($crate::io_format_err!($($msg)+));
|
||||||
}};
|
}};
|
||||||
}
|
}
|
||||||
|
|
||||||
#[doc(hidden)]
|
|
||||||
/// Non-panicking assertion: shortcut for returning an `io::Error` if the condition is not met.
|
|
||||||
/// Essentially: `if !expr { io_bail_last!() }`.
|
|
||||||
///
|
|
||||||
/// Note that this uses `errno`, care must be taken not to overwrite it with different value as a
|
|
||||||
/// side effect.
|
|
||||||
#[macro_export]
|
|
||||||
macro_rules! io_assert {
|
|
||||||
($value:expr) => {
|
|
||||||
if !$value {
|
|
||||||
$crate::io_bail_last!();
|
|
||||||
}
|
|
||||||
};
|
|
||||||
}
|
|
||||||
|
Loading…
Reference in New Issue
Block a user