2

I'm trying to edit a Rust project with the following structure:

src/iface/ip.rs

src/iface/tun.rs

I want to call things from ip.rs inside tun.rs. So on tun.rs I added:

use iface::ip;

but it says

unresolved import `iface::ip`

no `ip` in `iface`rustc(E0432)

This seems to be the way to do it as explained here https://stackoverflow.com/a/30687811/6655884 and here https://stackoverflow.com/a/26390046/6655884

I also tried mod ip but it didn't work either.

Guerlando OCs
  • 1,886
  • 9
  • 61
  • 150

1 Answers1

2

In iface/mod.rs

pub mod ip;

In iface/tun.rs

use crate::iface::ip;

tira
  • 68
  • 1
  • 5