#problem with mod
5 messages · Page 1 of 1 (latest)
Assuming you have all the relevant declarations, you can do one of the following:
use crate::traits::command;
use super::super::traits::command;
```Also since you're in vs code, you can use the rust-analyzer extension and tab-complete the name of the thing you want and it'll automatically give you the use statement. If it doesn't you probably forgot a mod declaration.
thank you, it worked. All the modules from my program needs to be "initialized" on the main.rs file?
No, only in their parent module/file.
Intuitively speaking, it's because modules don't exist automatically. A .rs file isn't automatically a module (except for src/main.rs or src/lib.rs), it needs to be declared by its parent module, which is what mod does