Follow

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use
Contact

What is the naming convention for a re-exporter?

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:

MEDevel.com: Open-source for Healthcare and Education

Collecting and validating open-source software for healthcare, education, enterprise, development, medical imaging, medical records, and digital pathology.

Visit Medevel

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.

Add a comment

Leave a Reply

Keep Up to Date with the Most Important News

By pressing the Subscribe button, you confirm that you have read and are agreeing to our Privacy Policy and Terms of Use

Discover more from Dev solutions

Subscribe now to keep reading and get access to the full archive.

Continue reading