Skip to content

Commit 86e3aa0

Browse files
committed
fmt by hand
1 parent d2d1794 commit 86e3aa0

File tree

1 file changed

+3
-6
lines changed

1 file changed

+3
-6
lines changed

clippy_lints/src/option_needless_deref.rs

+3-6
Original file line numberDiff line numberDiff line change
@@ -47,14 +47,12 @@ impl<'tcx> LateLintPass<'tcx> for OptionNeedlessDeref {
4747
let outer_ty = typeck.expr_ty(expr);
4848

4949
if_chain! {
50-
if is_type_diagnostic_item(cx,outer_ty,sym::option_type) ||
51-
is_type_diagnostic_item(cx,outer_ty,sym::result_type) ;
50+
if is_type_diagnostic_item(cx,outer_ty,sym::option_type);
5251
if let ExprKind::MethodCall(path, _, [sub_expr], _) = expr.kind;
53-
let symbol = &*path.ident.as_str();
54-
if symbol=="as_deref" || symbol=="as_deref_mut";
52+
let symbol = path.ident.as_str();
53+
if symbol=="as_deref" || symbol=="as_deref_mut";
5554
if TyS::same_type( outer_ty, typeck.expr_ty(sub_expr) );
5655
then{
57-
5856
span_lint_and_sugg(
5957
cx,
6058
OPTION_NEEDLESS_DEREF,
@@ -64,7 +62,6 @@ impl<'tcx> LateLintPass<'tcx> for OptionNeedlessDeref {
6462
snippet_opt(cx,sub_expr.span).unwrap(),
6563
Applicability::MachineApplicable
6664
);
67-
6865
}
6966
}
7067
}

0 commit comments

Comments
 (0)