@@ -80,18 +80,15 @@ impl VisitMut for HasSelf {
8080
8181pub struct ReplaceSelf ;
8282
83- impl ReplaceSelf {
84- #[ cfg_attr( not( self_span_hack) , allow( clippy:: unused_self) ) ]
85- fn prepend_underscore_to_self ( & self , ident : & mut Ident ) -> bool {
86- let modified = ident == "self" ;
87- if modified {
88- * ident = Ident :: new ( "__self" , ident. span ( ) ) ;
89- #[ cfg( self_span_hack) ]
90- ident. set_span ( self . 0 ) ;
91- }
92- modified
83+ fn prepend_underscore_to_self ( ident : & mut Ident ) -> bool {
84+ let modified = ident == "self" ;
85+ if modified {
86+ * ident = Ident :: new ( "__self" , ident. span ( ) ) ;
9387 }
88+ modified
89+ }
9490
91+ impl ReplaceSelf {
9592 fn visit_token_stream ( & mut self , tokens : & mut TokenStream ) -> bool {
9693 let mut out = Vec :: new ( ) ;
9794 let mut modified = false ;
@@ -110,7 +107,7 @@ impl ReplaceSelf {
110107 for tt in tokens {
111108 match tt {
112109 TokenTree :: Ident ( mut ident) => {
113- * modified |= visitor . prepend_underscore_to_self ( & mut ident) ;
110+ * modified |= prepend_underscore_to_self ( & mut ident) ;
114111 out. push ( TokenTree :: Ident ( ident) ) ;
115112 }
116113 TokenTree :: Group ( group) => {
@@ -129,7 +126,7 @@ impl ReplaceSelf {
129126
130127impl VisitMut for ReplaceSelf {
131128 fn visit_ident_mut ( & mut self , i : & mut Ident ) {
132- self . prepend_underscore_to_self ( i) ;
129+ prepend_underscore_to_self ( i) ;
133130 }
134131
135132 fn visit_path_mut ( & mut self , p : & mut Path ) {
0 commit comments