summaryrefslogtreecommitdiff
path: root/iter_patterns
diff options
context:
space:
mode:
Diffstat (limited to 'iter_patterns')
-rw-r--r--iter_patterns/src/lib.rs16
1 files changed, 10 insertions, 6 deletions
diff --git a/iter_patterns/src/lib.rs b/iter_patterns/src/lib.rs
index abd072e..657b538 100644
--- a/iter_patterns/src/lib.rs
+++ b/iter_patterns/src/lib.rs
@@ -1,4 +1,4 @@
-#![feature(slice_patterns, bind_by_move_pattern_guards)]
+#![feature(slice_patterns)]
/* Destructure an iterator using the syntax of slice_patterns.
* Wraps the match body in `Some` if there was a match; returns
@@ -174,11 +174,15 @@ macro_rules! match_vec {
)
};
(@make_filter; $variant:ident ($x:ident).., $($rest:tt)*) => {
- $x.iter()
- .all(|x| match x {
- $variant(_) => true,
- _ => false,
- })
+ {
+ // Circumvent https://github.com/rust-lang/rust/issues/59803
+ let is_all_variant = || $x.iter()
+ .all(|x| match x {
+ $variant(_) => true,
+ _ => false,
+ });
+ is_all_variant()
+ }
&&
$crate::match_vec!(@make_filter;
$($rest)*