@@ -8,7 +8,7 @@ use syn::{Expr, Ident, ItemImpl};
88use crate :: constant:: PhpConstAttribute ;
99use crate :: function:: { Args , CallType , Function , MethodReceiver } ;
1010use crate :: helpers:: get_docs;
11- use crate :: parsing:: { MethodRename , PhpRename , Rename , RenameRule , Visibility } ;
11+ use crate :: parsing:: { PhpRename , RenameRule , Visibility } ;
1212use crate :: prelude:: * ;
1313
1414/// Method types.
@@ -48,8 +48,7 @@ pub fn parser(mut input: ItemImpl) -> Result<TokenStream> {
4848 let mut parsed = ParsedImpl :: new (
4949 path,
5050 args. rename_methods . unwrap_or ( RenameRule :: Camel ) ,
51- args. rename_constants
52- . unwrap_or ( RenameRule :: ScreamingSnakeCase ) ,
51+ args. rename_constants . unwrap_or ( RenameRule :: ScreamingSnake ) ,
5352 ) ;
5453 parsed. parse ( input. items . iter_mut ( ) ) ?;
5554
@@ -184,8 +183,9 @@ impl<'a> ParsedImpl<'a> {
184183 match items {
185184 syn:: ImplItem :: Const ( c) => {
186185 let attr = PhpConstAttribute :: from_attributes ( & c. attrs ) ?;
187- let name = c. ident . rename ( self . rename_constants ) ;
188- let name = attr. rename . rename ( name) ;
186+ let name = attr
187+ . rename
188+ . rename ( c. ident . to_string ( ) , self . rename_constants ) ;
189189 let docs = get_docs ( & attr. attrs ) ?;
190190 c. attrs . retain ( |attr| !attr. path ( ) . is_ident ( "php" ) ) ;
191191
@@ -197,8 +197,9 @@ impl<'a> ParsedImpl<'a> {
197197 }
198198 syn:: ImplItem :: Fn ( method) => {
199199 let attr = PhpFunctionImplAttribute :: from_attributes ( & method. attrs ) ?;
200- let name = method. sig . ident . rename_method ( self . rename_methods ) ;
201- let name = attr. rename . rename ( name) ;
200+ let name = attr
201+ . rename
202+ . rename_method ( method. sig . ident . to_string ( ) , self . rename_methods ) ;
202203 let docs = get_docs ( & attr. attrs ) ?;
203204 method. attrs . retain ( |attr| !attr. path ( ) . is_ident ( "php" ) ) ;
204205
0 commit comments