@@ -389,8 +389,8 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
389389 & ExprMethodCall ( method_name, _, ref method_args) ) = ( pat, & match_expr. node ) {
390390 let iter_expr = & method_args[ 0 ] ;
391391 let lhs_constructor = last_path_segment ( qpath) ;
392- if method_name. node . as_str ( ) == "next" && match_trait_method ( cx, match_expr, & paths:: ITERATOR ) &&
393- lhs_constructor. name . as_str ( ) == "Some" && !is_refutable ( cx, & pat_args[ 0 ] ) &&
392+ if method_name. node == "next" && match_trait_method ( cx, match_expr, & paths:: ITERATOR ) &&
393+ lhs_constructor. name == "Some" && !is_refutable ( cx, & pat_args[ 0 ] ) &&
394394 !is_iterator_used_after_while_let ( cx, iter_expr) {
395395 let iterator = snippet ( cx, method_args[ 0 ] . span , "_" ) ;
396396 let loop_var = snippet ( cx, pat_args[ 0 ] . span , "_" ) ;
@@ -409,7 +409,7 @@ impl<'a, 'tcx> LateLintPass<'a, 'tcx> for Pass {
409409 fn check_stmt ( & mut self , cx : & LateContext < ' a , ' tcx > , stmt : & ' tcx Stmt ) {
410410 if let StmtSemi ( ref expr, _) = stmt. node {
411411 if let ExprMethodCall ( ref method, _, ref args) = expr. node {
412- if args. len ( ) == 1 && method. node . as_str ( ) == "collect" &&
412+ if args. len ( ) == 1 && method. node == "collect" &&
413413 match_trait_method ( cx, expr, & paths:: ITERATOR ) {
414414 span_lint ( cx,
415415 UNUSED_COLLECT ,
@@ -579,7 +579,7 @@ fn is_len_call(expr: &Expr, var: &Name) -> bool {
579579 if_let_chain ! { [
580580 let ExprMethodCall ( method, _, ref len_args) = expr. node,
581581 len_args. len( ) == 1 ,
582- method. node. as_str ( ) == "len" ,
582+ method. node == "len" ,
583583 let ExprPath ( QPath :: Resolved ( _, ref path) ) = len_args[ 0 ] . node,
584584 path. segments. len( ) == 1 ,
585585 path. segments[ 0 ] . name == * var
@@ -664,11 +664,11 @@ fn check_for_loop_arg(cx: &LateContext, pat: &Pat, arg: &Expr, expr: &Expr) {
664664 if let ExprMethodCall ( ref method, _, ref args) = arg. node {
665665 // just the receiver, no arguments
666666 if args. len ( ) == 1 {
667- let method_name = & * method. node . as_str ( ) ;
667+ let method_name = method. node . as_str ( ) ;
668668 // check for looping over x.iter() or x.iter_mut(), could use &x or &mut x
669669 if method_name == "iter" || method_name == "iter_mut" {
670670 if is_ref_iterable_type ( cx, & args[ 0 ] ) {
671- lint_iter_method ( cx, args, arg, method_name) ;
671+ lint_iter_method ( cx, args, arg, & method_name) ;
672672 }
673673 } else if method_name == "into_iter" && match_trait_method ( cx, arg, & paths:: INTO_ITERATOR ) {
674674 let method_call = ty:: MethodCall :: expr ( arg. id ) ;
@@ -680,7 +680,7 @@ fn check_for_loop_arg(cx: &LateContext, pat: &Pat, arg: &Expr, expr: &Expr) {
680680 let fn_arg_tys = fn_ty. fn_args ( ) ;
681681 assert_eq ! ( fn_arg_tys. skip_binder( ) . len( ) , 1 ) ;
682682 if fn_arg_tys. skip_binder ( ) [ 0 ] . is_region_ptr ( ) {
683- lint_iter_method ( cx, args, arg, method_name) ;
683+ lint_iter_method ( cx, args, arg, & method_name) ;
684684 } else {
685685 let object = snippet ( cx, args[ 0 ] . span , "_" ) ;
686686 span_lint_and_sugg ( cx,
0 commit comments