Conversation
clippy_lints/src/booleans.rs
Outdated
| .iter().cloned() | ||
| .flat_map(|(a, b)| vec![(a, b), (b, a)]) | ||
| .find(|&(a, _)| a == path.name.as_str()) | ||
| .find(|&(a, _)| a == path.ident.name.as_str()) |
There was a problem hiding this comment.
ident.as_str() works too (applicable to all something.ident.name.as_str() here and below).
There was a problem hiding this comment.
Ah, I made note to myself to check that and forgot about it.
clippy_lints/src/let_if_seq.rs
Outdated
| if let hir::StmtDecl(ref decl, _) = stmt.node; | ||
| if let hir::DeclLocal(ref decl) = decl.node; | ||
| if let hir::PatKind::Binding(mode, canonical_id, ref name, None) = decl.pat.node; | ||
| if let hir::PatKind::Binding(mode, canonical_id, ref ident, None) = decl.pat.node; |
There was a problem hiding this comment.
ident is small and Copy, so the ref is not necessary (applicable to all PatKind::Bindings).
There was a problem hiding this comment.
I thought there is clippy lint for it, nice catch.
There was a problem hiding this comment.
I think the lint for that applies only on function arguments and not on matching. This could be a nice addition to that lint though!
clippy_lints/src/matches.rs
Outdated
| print::to_string(print::NO_ANN, |s| s.print_qpath(path, false)) | ||
| }, | ||
| PatKind::Binding(BindingAnnotation::Unannotated, _, ident, None) => ident.node.to_string(), | ||
| PatKind::Binding(BindingAnnotation::Unannotated, _, ident, None) => ident.name.to_string(), |
There was a problem hiding this comment.
ident.to_string() works too.
|
Thank you @petrochenkov for reviewing this. I'll squash review commits (and more fixes is any) later. |
|
Squashed with minor fix for rust-lang/rust#50997 Update scripts don't work on Arch but I'll fix it. |
rust-lang/rust#51492 has made small changes to HIR.
I can bump version after new nightly is released.