mirror of
https://github.com/eyre-rs/eyre.git
synced 2025-09-29 22:11:55 +00:00
Remove unneeded parens in ensure macro
This commit is contained in:
parent
dd1876cb32
commit
c5e1ca0e04
@ -352,12 +352,12 @@ macro_rules! bail {
|
|||||||
#[macro_export]
|
#[macro_export]
|
||||||
macro_rules! ensure {
|
macro_rules! ensure {
|
||||||
($cond:expr, $err:expr $(,)?) => {
|
($cond:expr, $err:expr $(,)?) => {
|
||||||
if !($cond) {
|
if !$cond {
|
||||||
return std::result::Result::Err($crate::anyhow!($err));
|
return std::result::Result::Err($crate::anyhow!($err));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
($cond:expr, $fmt:expr, $($arg:tt)*) => {
|
($cond:expr, $fmt:expr, $($arg:tt)*) => {
|
||||||
if !($cond) {
|
if !$cond {
|
||||||
return std::result::Result::Err($crate::anyhow!($fmt, $($arg)*));
|
return std::result::Result::Err($crate::anyhow!($fmt, $($arg)*));
|
||||||
}
|
}
|
||||||
};
|
};
|
||||||
|
Loading…
x
Reference in New Issue
Block a user