I have a Rust project with the structure:
.
├── Cargo.lock
├── Cargo.toml
├── src
│ ├── routes
│ │ ├── mod.rs
│ │ ├── router_get.rs
│ │ └── router_post.rs
│ ├── main.rs
│ └── server.rs
I need to use the routes module in server.rs
, but when I am trying to compile it, it gives me an error:
error[E0432]: unresolved import `super::routes`
--> src/server.rs:10:5
|
10 | use super::routes;
| ^^^^^^^^^^ no `routes` in the root
When I try use routes
in main.rs
with mod routes
, everything is ok. But I need to use it in server.rs
.
routes/mod.rs
pub mod router_get;
pub mod router_post;