Skip to content

Commit e706322

Browse files
author
Donald Robertson
committed
Combining if statements per lint warnings on build
1 parent 9c73f7f commit e706322

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

clippy_lints/src/methods.rs

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -997,11 +997,9 @@ fn lint_expect_fun_call(cx: &LateContext, expr: &hir::Expr, method_span: Span, n
997997
fn extract_format_args(arg: &hir::Expr) -> Option<&hir::HirVec<hir::Expr>> {
998998
if let hir::ExprAddrOf(_, ref addr_of) = arg.node {
999999
if let hir::ExprCall(ref inner_fun, ref inner_args) = addr_of.node {
1000-
if is_expn_of(inner_fun.span, "format").is_some() {
1001-
if inner_args.len() == 1 {
1002-
if let hir::ExprCall(_, ref format_args) = inner_args[0].node {
1003-
return Some(format_args);
1004-
}
1000+
if is_expn_of(inner_fun.span, "format").is_some() && inner_args.len() == 1 {
1001+
if let hir::ExprCall(_, ref format_args) = inner_args[0].node {
1002+
return Some(format_args);
10051003
}
10061004
}
10071005
}

0 commit comments

Comments
 (0)