Skip to content

Commit 08ca58c

Browse files
authored
Merge pull request #78 from jannik4/fix-macro-doc
Fix docs for `ensure` and `ensure_eq` macros
2 parents 9eee21d + 4758056 commit 08ca58c

File tree

1 file changed

+5
-5
lines changed

1 file changed

+5
-5
lines changed

src/macros.rs

Lines changed: 5 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -12,7 +12,7 @@ macro_rules! bail {
1212
};
1313
}
1414

15-
/// Return early with an error if two expressions are not equal to each other.
15+
/// Return early with an error if a condition is not satisfied.
1616
///
1717
/// This macro is equivalent to `if !$cond { return Err(From::from($err)); }`.
1818
///
@@ -38,12 +38,12 @@ macro_rules! ensure {
3838
};
3939
}
4040

41-
/// Return early with an error if a condition is not satisfied.
41+
/// Return early with an error if two expressions are not equal to each other.
4242
///
43-
/// This macro is equivalent to `if !$cond { return Err(From::from($err)); }`.
43+
/// This macro is equivalent to `if $left != $right { return Err(From::from($err)); }`.
4444
///
45-
/// Analogously to `assert!`, `ensure!` takes a condition and exits the function
46-
/// if the condition fails. Unlike `assert!`, `ensure!` returns an `Error`
45+
/// Analogously to `assert_eq!`, `ensure_eq!` takes two expressions and exits the function
46+
/// if the expressions are not equal. Unlike `assert_eq!`, `ensure_eq!` returns an `Error`
4747
/// rather than panicking.
4848
#[macro_export]
4949
macro_rules! ensure_eq {

0 commit comments

Comments
 (0)