summaryrefslogtreecommitdiffstats
path: root/openpgp/src/macros.rs
diff options
context:
space:
mode:
authorIgor Matuszewski <igor@sequoia-pgp.org>2020-10-26 22:37:09 +0100
committerIgor Matuszewski <igor@sequoia-pgp.org>2020-10-26 22:53:50 +0100
commit0f1fc8e2e62fb6da00d3249949b233fbe6d69a6b (patch)
treeb620c1515189725a6b00787063235dfcb4f20356 /openpgp/src/macros.rs
parent4f8dfa8663026d02a778776843f29962339e0c75 (diff)
openpgp: Use std::matches! instead of custom destructures_to macro
Diffstat (limited to 'openpgp/src/macros.rs')
-rw-r--r--openpgp/src/macros.rs21
1 files changed, 0 insertions, 21 deletions
diff --git a/openpgp/src/macros.rs b/openpgp/src/macros.rs
index ba09c91c..822312f2 100644
--- a/openpgp/src/macros.rs
+++ b/openpgp/src/macros.rs
@@ -1,26 +1,5 @@
use std::cmp;
-// Turns an `if let` into an expression so that it is possible to do
-// things like:
-//
-// ```rust,nocompile
-// if destructures_to(Foo::Bar(_) = value)
-// || destructures_to(Foo::Bam(_) = value) { ... }
-// ```
-// TODO: Replace with `std::matches!` once MSRV is bumped to 1.42.
-macro_rules! destructures_to {
- ( $error: pat = $expr:expr ) => {
- {
- let x = $expr;
- if let $error = x {
- true
- } else {
- false
- }
- }
- };
-}
-
macro_rules! trace {
( $TRACE:expr, $fmt:expr, $($pargs:expr),* ) => {
if $TRACE {