File tree Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Expand file tree Collapse file tree 2 files changed +7
-3
lines changed Original file line number Diff line number Diff line change @@ -6,8 +6,8 @@ use std::path::PathBuf;
6
6
#[ derive( Debug ) ]
7
7
pub struct StructAttrs {
8
8
name : String ,
9
- pub rename_all : Option < RenameAll > ,
10
- pub rename : Option < String > ,
9
+ rename_all : Option < RenameAll > ,
10
+ rename : Option < String > ,
11
11
export : Option < PathBuf > ,
12
12
}
13
13
@@ -97,4 +97,8 @@ impl StructAttrs {
97
97
. unwrap_or_else ( || PathBuf :: new ( ) . join ( "bindings" ) )
98
98
. join ( format ! ( "{}.ts" , self . get_name( ) ) )
99
99
}
100
+
101
+ pub fn get_rename_all ( & self ) -> Option < & RenameAll > {
102
+ self . rename_all . as_ref ( )
103
+ }
100
104
}
Original file line number Diff line number Diff line change @@ -13,7 +13,7 @@ pub fn gen_ts_code(
13
13
continue ;
14
14
}
15
15
16
- let field_name = if let Some ( rename_all) = & struct_attrs. rename_all {
16
+ let field_name = if let Some ( rename_all) = struct_attrs. get_rename_all ( ) {
17
17
rename_all. to_case ( & ident. to_string ( ) )
18
18
} else {
19
19
ident. to_string ( )
You can’t perform that action at this time.
0 commit comments