Fix miscellaneous Clippy lints

This commit is contained in:
Aramis Razzaghipour 2021-10-03 23:45:08 +11:00
parent 55c0b86cde
commit eff195852d
No known key found for this signature in database
GPG key ID: F788F7E990136003
21 changed files with 40 additions and 51 deletions

View file

@ -161,7 +161,7 @@ impl fmt::Display for Subtree {
};
f.write_str(l)?;
let mut needs_space = false;
for tt in self.token_trees.iter() {
for tt in &self.token_trees {
if needs_space {
f.write_str(" ")?;
}
@ -215,7 +215,7 @@ impl Subtree {
.iter()
.map(|c| match c {
TokenTree::Subtree(c) => c.count(),
_ => 0,
TokenTree::Leaf(_) => 0,
})
.sum::<usize>();