On 04/17/2014 07:39 AM, Tommi wrote:
Can someone explain me why the module system maps to the file system in the way 
it does? The problem is that you can end up with these modules named mod.rs 
instead of the more informative names. If you have the following modules:

foo
foo::lut
bar
bar::lut

...that maps to files and folders as such:

foo/mod.rs
foo/lut.rs
bar/mod.rs
bar/lut.rs

...but why not map such modules to files and folders as the following:

foo.rs
foo/lut.rs
bar.rs
bar/lut.rs

...and have each module informatively named.

_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev


We did used to do exactly that, but it was considered very odd that part of a module is defined outside of it's directory and part inside. This structure can still be achieved in Rust with `#[path = "..."]` but it's not the opinionated default.
_______________________________________________
Rust-dev mailing list
Rust-dev@mozilla.org
https://mail.mozilla.org/listinfo/rust-dev

Reply via email to