Move module files into corresponding folder #118
Replies: 4 comments 2 replies
-
We changed it recently and there was a discussion on this: #102 Basically the mod.rs is the "old way" of doing this, and the new way to have a .rs name of the directory. This would make it easier when having lots of open files all called mod.rs |
Beta Was this translation helpful? Give feedback.
-
@blaumeise20 I had the same impression as you. So I was a little surprised when the Rust Book called the use of |
Beta Was this translation helpful? Give feedback.
-
The answer is as always it depends... |
Beta Was this translation helpful? Give feedback.
-
After using this system for a few days, i'm not entirely sure that the new module setup has more benefits. I find that having things in 2 directories is alightly more confusing and less ordered. |
Beta Was this translation helpful? Give feedback.
-
Currently the folder structure looks like this:
While this is allowed by Rust I don't think that structure will work in the long term when there will be way more subfolders in this project. The more common pattern looks like this:
Would you mind changing this structure?
Beta Was this translation helpful? Give feedback.
All reactions