It's indeed complicated but a good way to learn is to remember that as a rule of thumb, all your modules must be exported by main.rs or lib.rs (depending on the type of crate). In your final example, you don't need to do pub use, pub(crate) use works better to export the module to the entire crate without making it public API (if you're building a library project).
It's indeed complicated but a good way to learn is to remember that as a rule of thumb, all your modules must be exported by
main.rs
orlib.rs
(depending on the type of crate). In your final example, you don't need to dopub use
,pub(crate) use
works better to export the module to the entire crate without making it public API (if you're building a library project).Ooh. That's good to know, thank you :)