8135: more clippy::{perf, complexity, style} fixes r=Veykril a=matthiaskrgr



Co-authored-by: Matthias Krüger <matthias.krueger@famsik.de>
This commit is contained in:
bors[bot] 2021-03-21 15:49:31 +00:00 committed by GitHub
commit d51cf133f6
No known key found for this signature in database
GPG key ID: 4AEE18F83AFDEB23
39 changed files with 132 additions and 170 deletions

View file

@ -638,7 +638,7 @@ fn collect_attrs(
owner: &dyn ast::AttrsOwner,
) -> impl Iterator<Item = Either<ast::Attr, ast::Comment>> {
let (inner_attrs, inner_docs) = inner_attributes(owner.syntax())
.map_or((None, None), |(attrs, docs)| ((Some(attrs), Some(docs))));
.map_or((None, None), |(attrs, docs)| (Some(attrs), Some(docs)));
let outer_attrs = owner.attrs().filter(|attr| attr.excl_token().is_none());
let attrs = outer_attrs

View file

@ -472,7 +472,7 @@ impl Scope {
}
Scope::ExprScope(scope) => {
if let Some((label, name)) = scope.expr_scopes.label(scope.scope_id) {
f(name.clone(), ScopeDef::Label(label))
f(name, ScopeDef::Label(label))
}
scope.expr_scopes.entries(scope.scope_id).iter().for_each(|e| {
f(e.name().clone(), ScopeDef::Local(e.pat()));