Amending use of Some with discarded value to use is_some

This commit is contained in:
Donald Robertson 2018-06-06 17:13:31 +01:00
parent e67d2b2663
commit 9c73f7ff18

View File

@ -997,7 +997,7 @@ fn lint_expect_fun_call(cx: &LateContext, expr: &hir::Expr, method_span: Span, n
fn extract_format_args(arg: &hir::Expr) -> Option<&hir::HirVec<hir::Expr>> {
if let hir::ExprAddrOf(_, ref addr_of) = arg.node {
if let hir::ExprCall(ref inner_fun, ref inner_args) = addr_of.node {
if let Some(_) = is_expn_of(inner_fun.span, "format") {
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);