Apologies, if it's a duplicate questions. I looked online / stackoverflow and I couldn't find the answer. I want to import modules from different folders / files in Rust.
The structure of my files/ folders is the following:
src/
test_1/
mod.rs <- inside here I have put: pub mod a, and pub mod b
a.rs
b.rs
tes_2/
mod.rs <- inside here I have put: pub mod a1, and pub mod b1
a1.rs
b1.rs
test_3/
mod.rs<- inside here I have put: pub mod a2, and pub mod b2
a2.rs
b2.rs
I want to share code I have in a.rs
with a1.rs
and a2.rs
or the code I have in b2.rs
with a.rs
.
I have tried to add mod and use inside the files, I have also try many examples online but nothing worked.
Can you please help? Thanks in advance.