Let's say I have this file structure:
src >
- include.rs
- main.rs
- other.rs
I want to include include.rs
in main.rs
and other.rs
. I can do mod include
in main.rs
, but what do I do in other.rs
to include it there too?
Let's say I have this file structure:
src >
- include.rs
- main.rs
- other.rs
I want to include include.rs
in main.rs
and other.rs
. I can do mod include
in main.rs
, but what do I do in other.rs
to include it there too?
use crate::include;
mod
behaves the same way as fn
, struct
and enum
. It crates a thing in one place, and then you use
it from other places.
This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.