Skip to content

Commit 7bad5c3

Browse files
committed
fix: generate rust-valid module names
1 parent 2da44d2 commit 7bad5c3

File tree

1 file changed

+4
-1
lines changed

1 file changed

+4
-1
lines changed

rust/vbare-compiler/src/lib.rs

Lines changed: 4 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -80,12 +80,15 @@ pub fn process_schemas_with_config(
8080
mod_content.push_str("// Auto-generated module file for schemas\n\n");
8181

8282
for name in all_names {
83+
let module_name = name.replace('.', "_");
8384
mod_content.push_str(&formatdoc!(
8485
r#"
85-
pub mod {name} {{
86+
pub mod {module_name} {{
8687
include!(concat!(env!("OUT_DIR"), "/{name}_generated.rs"));
8788
}}
8889
"#,
90+
name = name,
91+
module_name = module_name,
8992
));
9093
}
9194

0 commit comments

Comments
 (0)