Skip to content

Commit 9b44e94

Browse files
committed
Allow specifying an invariant without a message
1 parent c0888a5 commit 9b44e94

File tree

1 file changed

+3
-0
lines changed

1 file changed

+3
-0
lines changed

src/assert.rs

Lines changed: 3 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -344,6 +344,9 @@ macro_rules! try_or_err {
344344
/// ```
345345
#[macro_export]
346346
macro_rules! invariant {
347+
($invariant: expr $(,)?) => {
348+
$crate::invariant!($invariant, $crate::VipersError::InvariantFailed);
349+
};
347350
($invariant: expr, $err_code: ident $(,)?) => {
348351
$crate::invariant!($invariant, crate::ErrorCode::$err_code);
349352
};

0 commit comments

Comments
 (0)