@@ -3,7 +3,7 @@ use clippy_utils::diagnostics::span_lint_and_sugg;
3
3
use clippy_utils:: source:: { indent_of, reindent_multiline, snippet_opt} ;
4
4
use clippy_utils:: ty:: is_type_diagnostic_item;
5
5
use clippy_utils:: usage:: contains_return_break_continue_macro;
6
- use clippy_utils:: { in_constant, match_qpath, path_to_local_id, sugg} ;
6
+ use clippy_utils:: { in_constant, match_qpath, path_to_local_id, paths , sugg} ;
7
7
use if_chain:: if_chain;
8
8
use rustc_errors:: Applicability ;
9
9
use rustc_hir:: { Arm , Expr , ExprKind , Pat , PatKind } ;
@@ -75,16 +75,16 @@ fn lint_manual_unwrap_or<'tcx>(cx: &LateContext<'tcx>, expr: &'tcx Expr<'tcx>) {
75
75
if let Some ( ( idx, or_arm) ) = arms. iter( ) . enumerate( ) . find( |( _, arm) |
76
76
match arm. pat. kind {
77
77
PatKind :: Path ( ref some_qpath) =>
78
- match_qpath( some_qpath, & clippy_utils :: paths:: OPTION_NONE ) ,
78
+ match_qpath( some_qpath, & paths:: OPTION_NONE ) ,
79
79
PatKind :: TupleStruct ( ref err_qpath, & [ Pat { kind: PatKind :: Wild , .. } ] , _) =>
80
- match_qpath( err_qpath, & clippy_utils :: paths:: RESULT_ERR ) ,
80
+ match_qpath( err_qpath, & paths:: RESULT_ERR ) ,
81
81
_ => false ,
82
82
}
83
83
) ;
84
84
let unwrap_arm = & arms[ 1 - idx] ;
85
85
if let PatKind :: TupleStruct ( ref unwrap_qpath, & [ unwrap_pat] , _) = unwrap_arm. pat. kind;
86
- if match_qpath( unwrap_qpath, & clippy_utils :: paths:: OPTION_SOME )
87
- || match_qpath( unwrap_qpath, & clippy_utils :: paths:: RESULT_OK ) ;
86
+ if match_qpath( unwrap_qpath, & paths:: OPTION_SOME )
87
+ || match_qpath( unwrap_qpath, & paths:: RESULT_OK ) ;
88
88
if let PatKind :: Binding ( _, binding_hir_id, ..) = unwrap_pat. kind;
89
89
if path_to_local_id( unwrap_arm. body, binding_hir_id) ;
90
90
if !contains_return_break_continue_macro( or_arm. body) ;
0 commit comments