From b441b4e8effeaf4532fd2e45c4d864480857c49e Mon Sep 17 00:00:00 2001 From: kjeremy Date: Wed, 30 Oct 2019 13:36:37 -0400 Subject: Some clippy fixes --- crates/ra_mbe/src/mbe_expander/matcher.rs | 3 +-- crates/ra_mbe/src/syntax_bridge.rs | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-) (limited to 'crates/ra_mbe') diff --git a/crates/ra_mbe/src/mbe_expander/matcher.rs b/crates/ra_mbe/src/mbe_expander/matcher.rs index 0548e8512..33b9d483d 100644 --- a/crates/ra_mbe/src/mbe_expander/matcher.rs +++ b/crates/ra_mbe/src/mbe_expander/matcher.rs @@ -123,7 +123,6 @@ fn match_subtree( } None => bindings.push_optional(name), } - () } Op::Repeat { subtree, kind, separator } => { match_repeat(bindings, subtree, kind, separator, src)? @@ -159,7 +158,7 @@ impl<'a> TtIter<'a> { pub(crate) fn expect_lifetime(&mut self) -> Result<&tt::Ident, ()> { let ident = self.expect_ident()?; // check if it start from "`" - if ident.text.chars().next() != Some('\'') { + if !ident.text.starts_with('\'') { return Err(()); } Ok(ident) diff --git a/crates/ra_mbe/src/syntax_bridge.rs b/crates/ra_mbe/src/syntax_bridge.rs index 1b543c84b..592fcf527 100644 --- a/crates/ra_mbe/src/syntax_bridge.rs +++ b/crates/ra_mbe/src/syntax_bridge.rs @@ -383,7 +383,7 @@ mod tests { "#, ); let expansion = expand(&rules, "literals!(foo);"); - let tts = &[expansion.clone().into()]; + let tts = &[expansion.into()]; let buffer = tt::buffer::TokenBuffer::new(tts); let mut tt_src = SubtreeTokenSource::new(&buffer); let mut tokens = vec![]; -- cgit v1.2.3