mirror of
https://github.com/rust-lang/rust-analyzer.git
synced 2025-10-02 22:54:58 +00:00
Some clippy fixes
This commit is contained in:
parent
5806195bc1
commit
b441b4e8ef
17 changed files with 23 additions and 29 deletions
|
@ -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)
|
||||
|
|
|
@ -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![];
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue