aboutsummaryrefslogtreecommitdiff
path: root/crates/mbe/src/expander/matcher.rs
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2021-06-21 16:11:21 +0100
committerGitHub <[email protected]>2021-06-21 16:11:21 +0100
commit56e61bdfea5454dec4408a4947e037bcd042c886 (patch)
tree0bc42cbfcf5b6b502ad9fc3079cb4bdc5e8f110f /crates/mbe/src/expander/matcher.rs
parent25bf451c8426a68ecfdc3a1d1be1db9702dd41d8 (diff)
parent47747cd4120e260a144242aadd7732e11d133fe4 (diff)
Merge #9165
9165: Apply some clippy suggestions r=matklad a=clemenswasser Co-authored-by: Clemens Wasser <[email protected]>
Diffstat (limited to 'crates/mbe/src/expander/matcher.rs')
-rw-r--r--crates/mbe/src/expander/matcher.rs8
1 files changed, 4 insertions, 4 deletions
diff --git a/crates/mbe/src/expander/matcher.rs b/crates/mbe/src/expander/matcher.rs
index b4f2fe9a4..0d694b1a7 100644
--- a/crates/mbe/src/expander/matcher.rs
+++ b/crates/mbe/src/expander/matcher.rs
@@ -645,7 +645,7 @@ fn match_loop(pattern: &MetaTemplate, src: &tt::Subtree) -> Match {
645 None if match_res.err.is_none() => { 645 None if match_res.err.is_none() => {
646 bindings_builder.push_optional(&mut item.bindings, name); 646 bindings_builder.push_optional(&mut item.bindings, name);
647 } 647 }
648 _ => {} 648 None => {}
649 } 649 }
650 if let Some(err) = match_res.err { 650 if let Some(err) = match_res.err {
651 res.add_err(err); 651 res.add_err(err);
@@ -756,7 +756,7 @@ impl<'a> TtIter<'a> {
756 let ok = match separator { 756 let ok = match separator {
757 Separator::Ident(lhs) if idx == 0 => match fork.expect_ident_or_underscore() { 757 Separator::Ident(lhs) if idx == 0 => match fork.expect_ident_or_underscore() {
758 Ok(rhs) => rhs.text == lhs.text, 758 Ok(rhs) => rhs.text == lhs.text,
759 _ => false, 759 Err(_) => false,
760 }, 760 },
761 Separator::Literal(lhs) if idx == 0 => match fork.expect_literal() { 761 Separator::Literal(lhs) if idx == 0 => match fork.expect_literal() {
762 Ok(rhs) => match rhs { 762 Ok(rhs) => match rhs {
@@ -764,11 +764,11 @@ impl<'a> TtIter<'a> {
764 tt::Leaf::Ident(rhs) => rhs.text == lhs.text, 764 tt::Leaf::Ident(rhs) => rhs.text == lhs.text,
765 tt::Leaf::Punct(_) => false, 765 tt::Leaf::Punct(_) => false,
766 }, 766 },
767 _ => false, 767 Err(_) => false,
768 }, 768 },
769 Separator::Puncts(lhss) if idx < lhss.len() => match fork.expect_punct() { 769 Separator::Puncts(lhss) if idx < lhss.len() => match fork.expect_punct() {
770 Ok(rhs) => rhs.char == lhss[idx].char, 770 Ok(rhs) => rhs.char == lhss[idx].char,
771 _ => false, 771 Err(_) => false,
772 }, 772 },
773 _ => false, 773 _ => false,
774 }; 774 };