Skip to content

Commit d0d49b3

Browse files
committed
fix
1 parent 60728c2 commit d0d49b3

File tree

2 files changed

+7
-3
lines changed

2 files changed

+7
-3
lines changed

crates/macros/src/struct_attrs.rs

Lines changed: 6 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -6,8 +6,8 @@ use std::path::PathBuf;
66
#[derive(Debug)]
77
pub struct StructAttrs {
88
name: String,
9-
pub rename_all: Option<RenameAll>,
10-
pub rename: Option<String>,
9+
rename_all: Option<RenameAll>,
10+
rename: Option<String>,
1111
export: Option<PathBuf>,
1212
}
1313

@@ -97,4 +97,8 @@ impl StructAttrs {
9797
.unwrap_or_else(|| PathBuf::new().join("bindings"))
9898
.join(format!("{}.ts", self.get_name()))
9999
}
100+
101+
pub fn get_rename_all(&self) -> Option<&RenameAll> {
102+
self.rename_all.as_ref()
103+
}
100104
}

crates/macros/src/ts/gen_ts_code.rs

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -13,7 +13,7 @@ pub fn gen_ts_code(
1313
continue;
1414
}
1515

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() {
1717
rename_all.to_case(&ident.to_string())
1818
} else {
1919
ident.to_string()

0 commit comments

Comments
 (0)