I’m currently trying to learn Rust, and am having a bit of a fight with the module system.
My idea was to structure my project into different files because keeping everything in the same one gets ugly rather fast…
So I now have these files:
src \--main.rs |--definitions.rs |--parsing.rs |--evaluation.rs
definitions.rs just contains some enum declarations,
evaluation.rs both operate with the data structures defined in
main.rs uses stuff from all three of these files.
Now, how can I structure that in a way that works, preferably without having a folder for each new file?
I tried using
//main.rs pub mod parsing; pub mod evaluation; pub mod definitions; //parsing.rs and evaluation.rs pub mod definitions; //also tried use definitions;
However nothing I tried is really working. Is this even how I am supposed to structure my project when writing idiomatic Rust code?
Thank you for your help