File tree Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Expand file tree Collapse file tree 1 file changed +13
-12
lines changed Original file line number Diff line number Diff line change @@ -2559,26 +2559,27 @@ fn lint_map_or_none<'a, 'tcx>(
2559
2559
return ;
2560
2560
}
2561
2561
2562
- let default_arg_is_none = if let hir:: ExprKind :: Path ( ref qpath) = map_or_args[ 1 ] . kind {
2563
- match_qpath ( qpath, & paths:: OPTION_NONE )
2564
- } else {
2565
- false
2566
- } ;
2567
2562
2568
- // This is really only needed if `is_result` holds. Computing it here
2569
- // makes `mess`'s assignment a bit easier, so just compute it here.
2570
- let f_arg_is_some = if let hir:: ExprKind :: Path ( ref qpath) = map_or_args[ 2 ] . kind {
2571
- match_qpath ( qpath, & paths:: OPTION_SOME )
2572
- } else {
2573
- false
2574
- } ;
2575
2563
2576
2564
let ( lint, msg, instead, hint) = {
2565
+
2566
+ let default_arg_is_none = if let hir:: ExprKind :: Path ( ref qpath) = map_or_args[ 1 ] . kind {
2567
+ match_qpath ( qpath, & paths:: OPTION_NONE )
2568
+ } else {
2569
+ return ;
2570
+ } ;
2571
+
2577
2572
if !default_arg_is_none {
2578
2573
// nothing to lint!
2579
2574
return ;
2580
2575
}
2581
2576
2577
+ let f_arg_is_some = if let hir:: ExprKind :: Path ( ref qpath) = map_or_args[ 2 ] . kind {
2578
+ match_qpath ( qpath, & paths:: OPTION_SOME )
2579
+ } else {
2580
+ false
2581
+ } ;
2582
+
2582
2583
if is_option {
2583
2584
let self_snippet = snippet ( cx, map_or_args[ 0 ] . span , ".." ) ;
2584
2585
let func_snippet = snippet ( cx, map_or_args[ 2 ] . span , ".." ) ;
You can’t perform that action at this time.
0 commit comments