Do not store attrs in FnKind.

This commit is contained in:
Camille GILLOT
2020-11-27 09:24:42 +01:00
parent 8d5e0f512f
commit 476c5283d5
10 changed files with 19 additions and 20 deletions

View File

@@ -76,8 +76,8 @@ impl CognitiveComplexity {
if rust_cc > self.limit.limit() {
let fn_span = match kind {
FnKind::ItemFn(ident, _, _, _, _) | FnKind::Method(ident, _, _, _) => ident.span,
FnKind::Closure(_) => {
FnKind::ItemFn(ident, _, _, _) | FnKind::Method(ident, _, _) => ident.span,
FnKind::Closure => {
let header_span = body_span.with_hi(decl.output.span().lo());
let pos = snippet_opt(cx, header_span).and_then(|snip| {
let low_offset = snip.find('|')?;