]> git.lizzy.rs Git - rust.git/commitdiff
Fix clippy
authorScott McMurray <scottmcm@users.noreply.github.com>
Sat, 1 May 2021 01:40:34 +0000 (18:40 -0700)
committerScott McMurray <scottmcm@users.noreply.github.com>
Thu, 6 May 2021 18:37:45 +0000 (11:37 -0700)
clippy_lints/src/needless_question_mark.rs
clippy_lints/src/try_err.rs
clippy_lints/src/unused_io_amount.rs

index 7b156a8c49dd9d93aec449e7898ce3acb7c09dba..d8417c7dc70d80a09ff72ec86258b13c430dab48 100644 (file)
@@ -147,7 +147,7 @@ fn is_some_or_ok_call<'a>(cx: &'a LateContext<'_>, expr: &'a Expr<'_>) -> Option
         if let ExprKind::Call(called, args) = &inner_expr_with_q.kind;
         if args.len() == 1;
 
         if let ExprKind::Call(called, args) = &inner_expr_with_q.kind;
         if args.len() == 1;
 
-        if let ExprKind::Path(QPath::LangItem(LangItem::TryIntoResult, _)) = &called.kind;
+        if let ExprKind::Path(QPath::LangItem(LangItem::TryTraitBranch, _)) = &called.kind;
         then {
             // Extract inner expr type from match argument generated by
             // question mark operator
         then {
             // Extract inner expr type from match argument generated by
             // question mark operator
index ebb39ea4877dee0268807ccca366b5ae5e9c974d..f2ba2b2ecf63976a7781f118cdf8ecd7566c1e4b 100644 (file)
@@ -64,7 +64,7 @@ fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
             if let ExprKind::Match(match_arg, _, MatchSource::TryDesugar) = expr.kind;
             if let ExprKind::Call(match_fun, try_args) = match_arg.kind;
             if let ExprKind::Path(ref match_fun_path) = match_fun.kind;
             if let ExprKind::Match(match_arg, _, MatchSource::TryDesugar) = expr.kind;
             if let ExprKind::Call(match_fun, try_args) = match_arg.kind;
             if let ExprKind::Path(ref match_fun_path) = match_fun.kind;
-            if matches!(match_fun_path, QPath::LangItem(LangItem::TryIntoResult, _));
+            if matches!(match_fun_path, QPath::LangItem(LangItem::TryTraitBranch, _));
             if let Some(try_arg) = try_args.get(0);
             if let ExprKind::Call(err_fun, err_args) = try_arg.kind;
             if let Some(err_arg) = err_args.get(0);
             if let Some(try_arg) = try_args.get(0);
             if let ExprKind::Call(err_fun, err_args) = try_arg.kind;
             if let Some(err_arg) = err_args.get(0);
index 3387f35bac3d4fea903d4145fbb247dc5e8b5f49..c27a6d4e347b5893f6c7f2b6b07ca3e6a51a0c47 100644 (file)
@@ -45,7 +45,7 @@ fn check_stmt(&mut self, cx: &LateContext<'_>, s: &hir::Stmt<'_>) {
                 if let hir::ExprKind::Call(func, args) = res.kind {
                     if matches!(
                         func.kind,
                 if let hir::ExprKind::Call(func, args) = res.kind {
                     if matches!(
                         func.kind,
-                        hir::ExprKind::Path(hir::QPath::LangItem(hir::LangItem::TryIntoResult, _))
+                        hir::ExprKind::Path(hir::QPath::LangItem(hir::LangItem::TryTraitBranch, _))
                     ) {
                         check_map_error(cx, &args[0], expr);
                     }
                     ) {
                         check_map_error(cx, &args[0], expr);
                     }