I would like to structure my code so that an experienced Rust developer would not be confused when attempting to join my project.
Currently, I have a directory hierarchy that looks like this:
main.rs
types/
-types_pt1.rs
-types_pt2.rs
-re_exporter.rs
And re_exporter.rs looks like this:
pub mod types_pt1;
pub mod types_pt2;
Finally, main.rs looks like this:
#[path = "types/re_exporter.rs"]
mod re_exporter;
use crate::re_exporter::{types_pt1, types_pt2};
What is the convention for naming re_exporter.rs?
>Solution :
The naming convention most used is the one that Rust detects by default, that is rename your module mod types;, remove the #[path = "types/re_exporter.rs"] and put the code in either src/types.rs or src/types/mod.rs.