The Rust module rules are:

  • A source file is just its own module (except the special files main.rs, lib.rs and mod.rs).
  • A directory is just a module path component.
  • The file mod.rs is just the directory’s module.