Rust 2018 introduced a new directory structure foo.rs + foo/bar.rs to replace the old foo/mod.rs + foo/bar.rs for a module foo with submodule bar. While it solved the issue of "a bunch of tabs named mod.rs", it introduced a new problem. If a lib has multiple modules with submodules, most file browsers list directories before files,
This commit introduces a customized file hierarchy: for a module foo and its submodule bar, we place the source code in foo/foo.rs and foo/bar.rs respectively, so we can avoid mod.rs and also put source files of a module in a single directory.
For sure this breaks the community convention and we have to use the path attribute every time.
Rust 2018 introduced a new directory structure
foo.rs + foo/bar.rs
to replace the oldfoo/mod.rs + foo/bar.rs
for a modulefoo
with submodulebar
. While it solved the issue of "a bunch of tabs named mod.rs", it introduced a new problem. If a lib has multiple modules with submodules, most file browsers list directories before files,and thus visually
foo1
is far fromfoo1.rs
.This commit introduces a customized file hierarchy: for a module
foo
and its submodulebar
, we place the source code infoo/foo.rs
andfoo/bar.rs
respectively, so we can avoidmod.rs
and also put source files of a module in a single directory.For sure this breaks the community convention and we have to use the
path
attribute every time.