Skip to content

Better documentation for "No more mod.rs" #104

@KiChjang

Description

@KiChjang

https://rust-lang-nursery.github.io/edition-guide/rust-2018/module-system/path-clarity.html#no-more-modrs

In Rust 2018, mod.rs is no longer needed. foo.rs can just be foo.rs, and the submodule is still foo/bar.rs. This eliminates the special name, and if you have a bunch of files open in your editor, you can clearly see their names, instead of having a bunch of tabs named mod.rs.

Emphasis mine. I discovered that this does not mean that mod.rs can be eliminated from your projects once and for all -- instead, it means specifically that in the case where you have only src/foo/mod.rs, you can instead name it src/foo.rs and it'll work just fine.

Metadata

Metadata

Assignees

No one assigned

    Labels

    questionFurther information is requested

    Type

    No type
    No fields configured for issues without a type.

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions