[Solved] Using parent module siblings?

So here's the schema:

|- app/
|--- cargo.toml
|--- src/
|----- main.rs
|----- lib.rs
|- other/
|--- cargo.toml
|--- src/
|----- main.rs
|----- lib.rs

Forgive me if I'm using incorrect terminology; still pretty new; but here goes. What I want to do is access code from the app crate from inside the other crate. My first instinct tells me to do something like this:
use super::super::app::main, but that doesn't work; I get an error that says there are too many initial supers.rustc(E0433).

What's the correct way to use code from another module in this manner?

1 Like

Just after I posted, I actually figured it out. In the other/ directory, I had to edit cargo.toml to add the path to my dependencies, like so:

// other/cargo.toml
[dependencies]
app = { path = "../app" }

This topic was automatically closed 90 days after the last reply. New replies are no longer allowed.