Info
This post is auto-generated from RSS feed The Rust Programming Language Forum - Latest topics. Source: Merge two modules into one
Hello,
I am trying to merge 2 modules to get the same namespace:
pub mod mod0 {
pub mod sub_mod1 {
pub struct S1;
}
}
pub mod mod0 {
pub mod sub_mod2 {
pub struct S2;
}
}
mod mod1;
mod mod2;
pub use mod1::*;
pub use mod2::*;
fn main() {
mod0::sub_mod1::S1 //ok
mod0::sub_mod2::S2 // not merged
}
I don't want to create a folder or merge the files.
Is it possible ?
Thank you in advance for your help.
2 posts - 2 participants
🏷️ rust_feed