@@ -47,13 +47,13 @@ impl_lint_pass!(ManualMainSeparatorStr => [MANUAL_MAIN_SEPARATOR_STR]);
4747
4848impl LateLintPass < ' _ > for ManualMainSeparatorStr {
4949 fn check_expr ( & mut self , cx : & LateContext < ' _ > , expr : & Expr < ' _ > ) {
50- if self . msrv . meets ( msrvs:: PATH_MAIN_SEPARATOR_STR )
51- && let ( target, _) = peel_hir_expr_refs ( expr)
52- && is_trait_method ( cx, target, sym:: ToString )
53- && let ExprKind :: MethodCall ( path, receiver, & [ ] , _) = target. kind
50+ let ( target, _) = peel_hir_expr_refs ( expr) ;
51+ if let ExprKind :: MethodCall ( path, receiver, & [ ] , _) = target. kind
5452 && path. ident . name == sym:: to_string
5553 && let ExprKind :: Path ( QPath :: Resolved ( None , path) ) = receiver. kind
5654 && let Res :: Def ( DefKind :: Const , receiver_def_id) = path. res
55+ && is_trait_method ( cx, target, sym:: ToString )
56+ && self . msrv . meets ( msrvs:: PATH_MAIN_SEPARATOR_STR )
5757 && match_def_path ( cx, receiver_def_id, & paths:: PATH_MAIN_SEPARATOR )
5858 && let ty:: Ref ( _, ty, Mutability :: Not ) = cx. typeck_results ( ) . expr_ty_adjusted ( expr) . kind ( )
5959 && ty. is_str ( )
0 commit comments