diff --git a/src/macros.rs b/src/macros.rs index a0f4cae..d268319 100644 --- a/src/macros.rs +++ b/src/macros.rs @@ -114,10 +114,11 @@ macro_rules! bail { #[macro_export] macro_rules! ensure { ($cond:expr $(,)?) => { - $crate::ensure!( - $cond, - $crate::private::concat!("Condition failed: `", $crate::private::stringify!($cond), "`"), - ) + if !$cond { + return $crate::private::Err($crate::private::new_adhoc( + $crate::private::concat!("Condition failed: `", $crate::private::stringify!($cond), "`") + )); + } }; ($cond:expr, $msg:literal $(,)?) => { if !$cond {