aboutsummaryrefslogtreecommitdiff
path: root/crates/ra_mbe
diff options
context:
space:
mode:
authorbors[bot] <26634292+bors[bot]@users.noreply.github.com>2019-10-30 17:39:18 +0000
committerGitHub <[email protected]>2019-10-30 17:39:18 +0000
commiteee55d4663084a01ce80f5ee201d8e1e345417cd (patch)
tree7fc1497065d00cfba1cd00523ed9545886745da1 /crates/ra_mbe
parentd929f9c49bceb3b7c32ea45c5e55c42f168bbf34 (diff)
parentb441b4e8effeaf4532fd2e45c4d864480857c49e (diff)
Merge #2129
2129: Some clippy fixes r=kjeremy a=kjeremy Co-authored-by: kjeremy <[email protected]>
Diffstat (limited to 'crates/ra_mbe')
-rw-r--r--crates/ra_mbe/src/mbe_expander/matcher.rs3
-rw-r--r--crates/ra_mbe/src/syntax_bridge.rs2
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![];