mirror of
https://github.com/rust-lang/rust-clippy
synced 2024-11-14 17:07:17 +00:00
fmt
This commit is contained in:
parent
17155c8dca
commit
13834e6ad2
1 changed files with 8 additions and 7 deletions
|
@ -47,13 +47,14 @@ declare_lint_pass!(MatchResultOk => [MATCH_RESULT_OK]);
|
||||||
|
|
||||||
impl<'tcx> LateLintPass<'tcx> for MatchResultOk {
|
impl<'tcx> LateLintPass<'tcx> for MatchResultOk {
|
||||||
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
|
fn check_expr(&mut self, cx: &LateContext<'tcx>, expr: &'tcx Expr<'_>) {
|
||||||
let (let_pat, let_expr, ifwhile) = if let Some(higher::IfLet { let_pat, let_expr, .. }) = higher::IfLet::hir(cx, expr) {
|
let (let_pat, let_expr, ifwhile) =
|
||||||
(let_pat, let_expr, "if")
|
if let Some(higher::IfLet { let_pat, let_expr, .. }) = higher::IfLet::hir(cx, expr) {
|
||||||
} else if let Some(higher::WhileLet { let_pat, let_expr, .. }) = higher::WhileLet::hir(expr) {
|
(let_pat, let_expr, "if")
|
||||||
(let_pat, let_expr, "while")
|
} else if let Some(higher::WhileLet { let_pat, let_expr, .. }) = higher::WhileLet::hir(expr) {
|
||||||
} else {
|
(let_pat, let_expr, "while")
|
||||||
return
|
} else {
|
||||||
};
|
return;
|
||||||
|
};
|
||||||
|
|
||||||
if_chain! {
|
if_chain! {
|
||||||
if let ExprKind::MethodCall(_, ok_span, [ref result_types_0, ..], _) = let_expr.kind; //check is expr.ok() has type Result<T,E>.ok(, _)
|
if let ExprKind::MethodCall(_, ok_span, [ref result_types_0, ..], _) = let_expr.kind; //check is expr.ok() has type Result<T,E>.ok(, _)
|
||||||
|
|
Loading…
Reference in a new issue