]> git.lizzy.rs Git - rust.git/blobdiff - clippy_lints/src/option_env_unwrap.rs
Rollup merge of #83092 - petrochenkov:qspan, r=estebank
[rust.git] / clippy_lints / src / option_env_unwrap.rs
index 96ab4238008d0f22ad4f536f864b39c89232c08f..fd653044a1bcb9fb6442041c6e2b4e1f39d90c21 100644 (file)
@@ -35,7 +35,7 @@
 impl EarlyLintPass for OptionEnvUnwrap {
     fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
         if_chain! {
-            if let ExprKind::MethodCall(path_segment, args) = &expr.kind;
+            if let ExprKind::MethodCall(path_segment, args, _) = &expr.kind;
             let method_name = path_segment.ident.as_str();
             if method_name == "expect" || method_name == "unwrap";
             if let ExprKind::Call(caller, _) = &args[0].kind;
@@ -46,6 +46,7 @@ fn check_expr(&mut self, cx: &EarlyContext<'_>, expr: &Expr) {
                     OPTION_ENV_UNWRAP,
                     expr.span,
                     "this will panic at run-time if the environment variable doesn't exist at compile-time",
+                    None,
                     "consider using the `env!` macro instead"
                 );
             }