Hacker Newsnew | past | comments | ask | show | jobs | submitlogin

I was expecting something about how you can't move code into a new file without creating a new module, which means you'll need to modify calling code if you want to reorganize stuff, so you end up with massive source files.


You mean that if you split a file you define another module when you declare it? That is only visible as a module at the level of declaration not beyond.

Also note that modules are not per se compile units.

Cf. See https://doc.rust-lang.org/rust-by-example/mod/split.html

Edit: typo.


You can fix this by doing `pub use module::*`.


wildcard import, definitely no drawbacks to those!




Consider applying for YC's Summer 2026 batch! Applications are open till May 4

Guidelines | FAQ | Lists | API | Security | Legal | Apply to YC | Contact

Search: