From 47747cd4120e260a144242aadd7732e11d133fe4 Mon Sep 17 00:00:00 2001 From: Clemens Wasser Date: Mon, 7 Jun 2021 13:59:01 +0200 Subject: Apply some clippy suggestions --- crates/mbe/src/expander/matcher.rs | 8 ++++---- crates/mbe/src/expander/transcriber.rs | 2 +- 2 files changed, 5 insertions(+), 5 deletions(-) (limited to 'crates/mbe/src/expander') 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 { None if match_res.err.is_none() => { bindings_builder.push_optional(&mut item.bindings, name); } - _ => {} + None => {} } if let Some(err) = match_res.err { res.add_err(err); @@ -756,7 +756,7 @@ impl<'a> TtIter<'a> { let ok = match separator { Separator::Ident(lhs) if idx == 0 => match fork.expect_ident_or_underscore() { Ok(rhs) => rhs.text == lhs.text, - _ => false, + Err(_) => false, }, Separator::Literal(lhs) if idx == 0 => match fork.expect_literal() { Ok(rhs) => match rhs { @@ -764,11 +764,11 @@ impl<'a> TtIter<'a> { tt::Leaf::Ident(rhs) => rhs.text == lhs.text, tt::Leaf::Punct(_) => false, }, - _ => false, + Err(_) => false, }, Separator::Puncts(lhss) if idx < lhss.len() => match fork.expect_punct() { Ok(rhs) => rhs.char == lhss[idx].char, - _ => false, + Err(_) => false, }, _ => false, }; diff --git a/crates/mbe/src/expander/transcriber.rs b/crates/mbe/src/expander/transcriber.rs index 49a137577..4894e2a0c 100644 --- a/crates/mbe/src/expander/transcriber.rs +++ b/crates/mbe/src/expander/transcriber.rs @@ -241,6 +241,6 @@ fn push_fragment(buf: &mut Vec, fragment: Fragment) { fn push_subtree(buf: &mut Vec, tt: tt::Subtree) { match tt.delimiter { None => buf.extend(tt.token_trees), - _ => buf.push(tt.into()), + Some(_) => buf.push(tt.into()), } } -- cgit v1.2.3