diff options
author | kjeremy <[email protected]> | 2019-10-30 17:36:37 +0000 |
---|---|---|
committer | kjeremy <[email protected]> | 2019-10-30 17:36:37 +0000 |
commit | b441b4e8effeaf4532fd2e45c4d864480857c49e (patch) | |
tree | 5f25f7478b8ec365b2a2d5f7bea4ec2386bdd244 /crates/ra_mbe | |
parent | 5806195bc1cdb1ca3fa257e99fd6e0dd897713a9 (diff) |
Some clippy fixes
Diffstat (limited to 'crates/ra_mbe')
-rw-r--r-- | crates/ra_mbe/src/mbe_expander/matcher.rs | 3 | ||||
-rw-r--r-- | crates/ra_mbe/src/syntax_bridge.rs | 2 |
2 files changed, 2 insertions, 3 deletions
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( | |||
123 | } | 123 | } |
124 | None => bindings.push_optional(name), | 124 | None => bindings.push_optional(name), |
125 | } | 125 | } |
126 | () | ||
127 | } | 126 | } |
128 | Op::Repeat { subtree, kind, separator } => { | 127 | Op::Repeat { subtree, kind, separator } => { |
129 | match_repeat(bindings, subtree, kind, separator, src)? | 128 | match_repeat(bindings, subtree, kind, separator, src)? |
@@ -159,7 +158,7 @@ impl<'a> TtIter<'a> { | |||
159 | pub(crate) fn expect_lifetime(&mut self) -> Result<&tt::Ident, ()> { | 158 | pub(crate) fn expect_lifetime(&mut self) -> Result<&tt::Ident, ()> { |
160 | let ident = self.expect_ident()?; | 159 | let ident = self.expect_ident()?; |
161 | // check if it start from "`" | 160 | // check if it start from "`" |
162 | if ident.text.chars().next() != Some('\'') { | 161 | if !ident.text.starts_with('\'') { |
163 | return Err(()); | 162 | return Err(()); |
164 | } | 163 | } |
165 | Ok(ident) | 164 | 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 { | |||
383 | "#, | 383 | "#, |
384 | ); | 384 | ); |
385 | let expansion = expand(&rules, "literals!(foo);"); | 385 | let expansion = expand(&rules, "literals!(foo);"); |
386 | let tts = &[expansion.clone().into()]; | 386 | let tts = &[expansion.into()]; |
387 | let buffer = tt::buffer::TokenBuffer::new(tts); | 387 | let buffer = tt::buffer::TokenBuffer::new(tts); |
388 | let mut tt_src = SubtreeTokenSource::new(&buffer); | 388 | let mut tt_src = SubtreeTokenSource::new(&buffer); |
389 | let mut tokens = vec![]; | 389 | let mut tokens = vec![]; |