I have the file structure: engine and utils folder on same level. Engine contains world folder (which contains mod.rs and map.rs) and mod.rs. Utils contains mod.rs and reader.rs.
I'm trying to access map from reader but cannot get the 'use' statement to work.
utils/mod.rs
pub mod reader;
engine/mod.rs
pub mod world;
world/mod.rs
pub mod map;
pub struct World;
I get this error:
error[E0433]: failed to resolve. Maybe a missing `extern crate engine;`?
--> src\utils\reader.rs:5:5
|
5 | use engine::world::map;
| ^^^^^^ Maybe a missing `extern crate engine;`?
Can you not declare modules inside of subdirectories, or am I missing something stupid? I've been messing about with use statements for about half an hour now and can't get it to work.