Skip to content

Commit 39030f9

Browse files
authored
Use snake_case when generating Rust filenames. (#525)
When generating a Rust file for a world named `cli-reactor`, name the file `cli_reactor.rs` so that Rust can refer to it with `mod cli_reactor`.
1 parent cd9d253 commit 39030f9

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

crates/rust/src/lib.rs

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -307,7 +307,8 @@ impl WorldGenerator for RustWasm {
307307
assert!(status.success());
308308
}
309309

310-
files.push(&format!("{name}.rs"), src.as_bytes());
310+
let module_name = name.to_snake_case();
311+
files.push(&format!("{module_name}.rs"), src.as_bytes());
311312
}
312313
}
313314

0 commit comments

Comments
 (0)