RS.CLIPPY.MOD_MODULE_FILES

Checks that module layout is consistent

This checker is a Clippy lint created by The Rust Project Contributors. The documentation shown here is a copy of the original documentation for: mod_module_files. Copyright ©2025 The Rust Team. All rights reserved.

What it does

Checks that module layout uses only self named module files; bans mod.rs files.

Why restrict this?

Having multiple module layout styles in a project can be confusing.

Example

src/
  stuff/
    stuff_files.rs
    mod.rs
  lib.rs

Use instead:

src/
  stuff/
    stuff_files.rs
  stuff.rs
  lib.rs