Sibling modules and traits

That could be misleading: you can have

  • In main.rs:
    mod printable;
    fn main() {}
    
  • In printable/mod.rs:
    mod printable;
    
  • And a printable/printable.rs file.

In the same way that the same file name can appear multiple times in the filesystem.

3 Likes