Comment by metaltyphoon
9 months ago
The do it because the first one sucked ass and the second is a huge improvement but you still have to support the old way.
9 months ago
The do it because the first one sucked ass and the second is a huge improvement but you still have to support the old way.
Which is which and why?
mod.rs came first and that made creating modules verbose as hell. Not only that but imagine having many mod.rs files open, you wouldn’t know what module you are in by just looking at the filename.
imagine having many lib.rs open?
mod.rs is better, change my mind
Sure, open 5 tabs named mod.rs, so which mod are you in?
Open 5 libs.rs, which crate are you in? Always look at full path instead of filename. A mod.rs means a much more cleaner organization, as you know that all of a folder module's content is within that module, and you don't have to look elsewhere.
2 replies →