]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/main_recursion.rs
ast/hir: Rename field-related structures
[rust.git] / clippy_lints / src / main_recursion.rs
index eceae706e4fc716c3c41ed948ef0fbffd275a2d9..1b274c79d3820b5a948efb4578adb3bf220b0e3f 100644 (file)
@@ -32,8 +32,8 @@ pub struct MainRecursion {
 impl_lint_pass!(MainRecursion => [MAIN_RECURSION]);
 
 impl LateLintPass<'_> for MainRecursion {
-    fn check_crate(&mut self, _: &LateContext<'_>, krate: &Crate<'_>) {
-        self.has_no_std_attr = is_no_std_crate(krate);
+    fn check_crate(&mut self, cx: &LateContext<'_>, _: &Crate<'_>) {
+        self.has_no_std_attr = is_no_std_crate(cx);
     }
 
     fn check_expr_post(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
@@ -43,8 +43,7 @@ fn check_expr_post(&mut self, cx: &LateContext<'_>, expr: &Expr<'_>) {
 
         if_chain! {
             if let ExprKind::Call(func, _) = &expr.kind;
-            if let ExprKind::Path(path) = &func.kind;
-            if let QPath::Resolved(_, path) = &path;
+            if let ExprKind::Path(QPath::Resolved(_, path)) = &func.kind;
             if let Some(def_id) = path.res.opt_def_id();
             if is_entrypoint_fn(cx, def_id);
             then {