diff options
author | bors[bot] <26634292+bors[bot]@users.noreply.github.com> | 2021-06-17 17:22:32 +0100 |
---|---|---|
committer | GitHub <[email protected]> | 2021-06-17 17:22:32 +0100 |
commit | ce926aebc4461e38535047958c0b6f72b7a0c0ea (patch) | |
tree | 4b844e0681b459836bac22c34bee43e4dfa3dc5f /crates/mbe | |
parent | 3ae0c5911ab50ee209179ee4329b0551abe6fc48 (diff) | |
parent | 02d25ab60d2701ce71fe2dfaca36627ad902e229 (diff) |
Merge #9315
9315: Nest all the or-patterns! r=Veykril a=Veykril
`cargo +nightly clippy --fix -Z unstable-options --allow-dirty -- -A clippy::all -D clippy::unnested_or_patterns`
Co-authored-by: Lukas Wirth <[email protected]>
Diffstat (limited to 'crates/mbe')
-rw-r--r-- | crates/mbe/src/expander/matcher.rs | 22 |
1 files changed, 3 insertions, 19 deletions
diff --git a/crates/mbe/src/expander/matcher.rs b/crates/mbe/src/expander/matcher.rs index c2a9a38c9..b4f2fe9a4 100644 --- a/crates/mbe/src/expander/matcher.rs +++ b/crates/mbe/src/expander/matcher.rs | |||
@@ -804,33 +804,17 @@ impl<'a> TtIter<'a> { | |||
804 | }; | 804 | }; |
805 | 805 | ||
806 | match (punct.char, second, third) { | 806 | match (punct.char, second, third) { |
807 | ('.', '.', Some('.')) | 807 | ('.', '.', Some('.' | '=')) | ('<', '<', Some('=')) | ('>', '>', Some('=')) => { |
808 | | ('.', '.', Some('=')) | ||
809 | | ('<', '<', Some('=')) | ||
810 | | ('>', '>', Some('=')) => { | ||
811 | let tt2 = self.next().unwrap().clone(); | 808 | let tt2 = self.next().unwrap().clone(); |
812 | let tt3 = self.next().unwrap().clone(); | 809 | let tt3 = self.next().unwrap().clone(); |
813 | Ok(tt::Subtree { delimiter: None, token_trees: vec![tt, tt2, tt3] }.into()) | 810 | Ok(tt::Subtree { delimiter: None, token_trees: vec![tt, tt2, tt3] }.into()) |
814 | } | 811 | } |
815 | ('-', '=', _) | 812 | ('-' | '!' | '*' | '/' | '&' | '%' | '^' | '+' | '<' | '=' | '>' | '|', '=', _) |
816 | | ('-', '>', _) | 813 | | ('-' | '=' | '>', '>', _) |
817 | | (':', ':', _) | 814 | | (':', ':', _) |
818 | | ('!', '=', _) | ||
819 | | ('.', '.', _) | 815 | | ('.', '.', _) |
820 | | ('*', '=', _) | ||
821 | | ('/', '=', _) | ||
822 | | ('&', '&', _) | 816 | | ('&', '&', _) |
823 | | ('&', '=', _) | ||
824 | | ('%', '=', _) | ||
825 | | ('^', '=', _) | ||
826 | | ('+', '=', _) | ||
827 | | ('<', '<', _) | 817 | | ('<', '<', _) |
828 | | ('<', '=', _) | ||
829 | | ('=', '=', _) | ||
830 | | ('=', '>', _) | ||
831 | | ('>', '=', _) | ||
832 | | ('>', '>', _) | ||
833 | | ('|', '=', _) | ||
834 | | ('|', '|', _) => { | 818 | | ('|', '|', _) => { |
835 | let tt2 = self.next().unwrap().clone(); | 819 | let tt2 = self.next().unwrap().clone(); |
836 | Ok(tt::Subtree { delimiter: None, token_trees: vec![tt, tt2] }.into()) | 820 | Ok(tt::Subtree { delimiter: None, token_trees: vec![tt, tt2] }.into()) |