summaryrefslogtreecommitdiffstats
path: root/openpgp/src/lib.rs
diff options
context:
space:
mode:
authorJustus Winter <justus@sequoia-pgp.org>2020-02-20 14:40:58 +0100
committerJustus Winter <justus@sequoia-pgp.org>2020-02-20 14:40:58 +0100
commit92d45767343fea932f7105f2ad548a69150f2bb2 (patch)
tree7d82f8a98bdcd5be390ef79ef7fce3e91e413037 /openpgp/src/lib.rs
parent2d92addba5e985994cebd8a41b8e921ba6137bc9 (diff)
openpgp: Improve assert_match!.
- Emit a block so that the macro can be used as expression.
Diffstat (limited to 'openpgp/src/lib.rs')
-rw-r--r--openpgp/src/lib.rs4
1 files changed, 2 insertions, 2 deletions
diff --git a/openpgp/src/lib.rs b/openpgp/src/lib.rs
index 986b445c..9c709835 100644
--- a/openpgp/src/lib.rs
+++ b/openpgp/src/lib.rs
@@ -117,7 +117,7 @@ fn vec_drain_prefix(v: &mut Vec<u8>, prefix_len: usize) {
// declare the modules.
#[allow(unused_macros)]
macro_rules! assert_match {
- ( $error: pat = $expr:expr, $fmt:expr, $($pargs:expr),* ) => {
+ ( $error: pat = $expr:expr, $fmt:expr, $($pargs:expr),* ) => {{
let x = $expr;
if let $error = x {
/* Pass. */
@@ -127,7 +127,7 @@ macro_rules! assert_match {
stringify!($error), x,
if $fmt.len() > 0 { ": " } else { "." }, extra);
}
- };
+ }};
( $error: pat = $expr: expr, $fmt:expr ) => {
assert_match!($error = $expr, $fmt, );
};