Absolute module reference

I've a local module that will be referred often, app. It'll be necessary to use super keywords diverse times:

use super::super::localization;

Is there a way to refer to this as simply this?

use app::localization;

That is the structure:

|__ src
| |____ app
| | |_____ localization.rs
| | |_____ main.rs

Note src/app/main.rs is the second entry-point.

crate::app will always refer to the app module inside the crate regardless of where you are in the module tree.

2 Likes