]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/cognitive_complexity.rs
ast/hir: Rename field-related structures
[rust.git] / clippy_lints / src / cognitive_complexity.rs
index b3ebdf4ca30d8d21119c6559b51f9782456d2bc2..658d445dfec54d0ad2e2a35bff964e571144bc84 100644 (file)
@@ -57,9 +57,9 @@ fn check<'tcx>(
 
         let expr = &body.value;
 
-        let mut helper = CCHelper { cc: 1, returns: 0 };
+        let mut helper = CcHelper { cc: 1, returns: 0 };
         helper.visit_expr(expr);
-        let CCHelper { cc, returns } = helper;
+        let CcHelper { cc, returns } = helper;
         let ret_ty = cx.typeck_results().node_type(expr.hir_id);
         let ret_adjust = if is_type_diagnostic_item(cx, ret_ty, sym::result_type) {
             returns
@@ -76,8 +76,8 @@ fn check<'tcx>(
 
         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('|')?;
@@ -136,12 +136,12 @@ fn exit_lint_attrs(&mut self, cx: &LateContext<'tcx>, attrs: &'tcx [Attribute])
     }
 }
 
-struct CCHelper {
+struct CcHelper {
     cc: u64,
     returns: u64,
 }
 
-impl<'tcx> Visitor<'tcx> for CCHelper {
+impl<'tcx> Visitor<'tcx> for CcHelper {
     type Map = Map<'tcx>;
 
     fn visit_expr(&mut self, e: &'tcx Expr<'_>) {