From e70632215e8cb6272599b1d07bfc0712f8a0d70a Mon Sep 17 00:00:00 2001 From: Donald Robertson Date: Wed, 6 Jun 2018 20:38:13 +0100 Subject: [PATCH] Combining if statements per lint warnings on build --- clippy_lints/src/methods.rs | 8 +++----- 1 file changed, 3 insertions(+), 5 deletions(-) diff --git a/clippy_lints/src/methods.rs b/clippy_lints/src/methods.rs index 9a93354af29..aafc612b512 100644 --- a/clippy_lints/src/methods.rs +++ b/clippy_lints/src/methods.rs @@ -997,11 +997,9 @@ fn lint_expect_fun_call(cx: &LateContext, expr: &hir::Expr, method_span: Span, n fn extract_format_args(arg: &hir::Expr) -> Option<&hir::HirVec> { if let hir::ExprAddrOf(_, ref addr_of) = arg.node { if let hir::ExprCall(ref inner_fun, ref inner_args) = addr_of.node { - if is_expn_of(inner_fun.span, "format").is_some() { - if inner_args.len() == 1 { - if let hir::ExprCall(_, ref format_args) = inner_args[0].node { - return Some(format_args); - } + if is_expn_of(inner_fun.span, "format").is_some() && inner_args.len() == 1 { + if let hir::ExprCall(_, ref format_args) = inner_args[0].node { + return Some(format_args); } } }