Skip to content

Revise advice about which naming convention to use for modules #1215

Open
@ssokolow

Description

@ssokolow

It seems people are interpreting this line in the Modules page of the reference...

It is encouraged to use the new naming convention as it is more consistent, and avoids having many files named mod.rs within a project.

...to mean that the mod.rs approach to laying out a project on disk is deprecated, which is at odds with this line from RFC 2126.

The use of mod.rs continues to be allowed without any deprecation. It is expected that tooling like Clippy will push for at least style consistency within a project, and perhaps eventually across the ecosystem.

It also refers to the new convention as "more consistent" when, without going into the RFC an enumerating the bullet points, moving away from having all the .rs files within a single folder feels differently consistent, not more so.

Please consider adjusting the phrasing to make it more clear that this is not an official statement of policy but merely a piece of advice.

Perhaps something along the lines of this:

If you are uncertain which convention to follow, we recommend using the new naming convention as it simplifies the addition of new submodules as your project grows and makes it easier for your editor to display unambiguous names for open files.

Metadata

Metadata

Assignees

No one assigned

    Labels

    Language CleanupImprovements to existing language which is correct but not clear, or missing examples, or the like.

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions