Some clippy fixes

This commit is contained in:
kjeremy 2019-10-30 13:36:37 -04:00
parent 5806195bc1
commit b441b4e8ef
17 changed files with 23 additions and 29 deletions

View file

@ -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)

View file

@ -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![];