pub mod users;
pub use users::details;
fn main() {
details::say_details();
println!("Hello, Yelsin");
}
user.rs
pub mod users {
pub mod details {
pub fn say_details() {
println!("His name is Yelsin, He his a BOY");
}
pub fn profession(name: String) {
println!("He his a {:?}", name);
}
}
}
No, that is not what was explained. Replace the contents of users.rs with the following:
pub mod details {
pub fn say_details() {
println!("His name is Yelsin, He his a BOY");
}
pub fn profession(name: String) {
println!("He his a {:?}", name);
}
}
Do not wrap it in a pub mod users block. This is predefined when you say pub mod users; in main.rs.
@ExpHP@OptimisticPeach@prataprc, I really appreciate you guys. Thanks @ExpHP you also solved the problem am the one that didn't get the explanation well.