File tree Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Expand file tree Collapse file tree 1 file changed +5
-5
lines changed Original file line number Diff line number Diff line change @@ -12,7 +12,7 @@ macro_rules! bail {
12
12
} ;
13
13
}
14
14
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 .
16
16
///
17
17
/// This macro is equivalent to `if !$cond { return Err(From::from($err)); }`.
18
18
///
@@ -38,12 +38,12 @@ macro_rules! ensure {
38
38
} ;
39
39
}
40
40
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 .
42
42
///
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)); }`.
44
44
///
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`
47
47
/// rather than panicking.
48
48
#[ macro_export]
49
49
macro_rules! ensure_eq {
You can’t perform that action at this time.
0 commit comments