mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-23 21:23:56 +00:00
Match attributes in FnKind patterns
This commit is contained in:
parent
523c596171
commit
a7f662d8f2
2 changed files with 2 additions and 2 deletions
|
@ -39,7 +39,7 @@ impl LintPass for TopLevelRefPass {
|
|||
|
||||
impl LateLintPass for TopLevelRefPass {
|
||||
fn check_fn(&mut self, cx: &LateContext, k: FnKind, decl: &FnDecl, _: &Block, _: Span, _: NodeId) {
|
||||
if let FnKind::Closure = k {
|
||||
if let FnKind::Closure(_) = k {
|
||||
// Does not apply to closures
|
||||
return;
|
||||
}
|
||||
|
|
|
@ -46,7 +46,7 @@ impl LateLintPass for NewWithoutDefault {
|
|||
return;
|
||||
}
|
||||
|
||||
if let FnKind::Method(name, _, _) = kind {
|
||||
if let FnKind::Method(name, _, _, _) = kind {
|
||||
if decl.inputs.is_empty() && name.as_str() == "new" {
|
||||
let self_ty = cx.tcx.lookup_item_type(cx.tcx.map.local_def_id(cx.tcx.map.get_parent(id))).ty;
|
||||
|
||||
|
|
Loading…
Reference in a new issue