[rust-dev] Why mod.rs files?

Evan G eg1290 at gmail.com
Thu Apr 17 09:22:13 PDT 2014


Sublime does this automatically.


On Thu, Apr 17, 2014 at 10:56 AM, Niko Matsakis <niko at alum.mit.edu> wrote:

> On Thu, Apr 17, 2014 at 05:39:15PM +0300, Tommi wrote:
> > ...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.
>
> This used to be our system and we found it very confusing in practice.
> Basically the code that was logically related to subsystem `foo` was
> divided between two directories, and that caused mental discord. I
> can't exactly explain *why*, but it certainly did, and hence we were
> unhappy enough to switch over to the current system.
>
> Note that you can use the `#[path=...]` attribute to override the
> defaults if you choose.
>
>
> Niko
>
> [1] If you are using emacs, I strongly suggest enabling the uniquify
> settings <http://www.emacswiki.org/emacs/uniquify>.  Otherwise you get
> useless buffer names like `mod.rs<2>` rather than `foo/mod.rs` and so
> on. I would hope that vim and SublimeText2 and whatever new-fangled
> editors people are using these days have similar options.
> _______________________________________________
> Rust-dev mailing list
> Rust-dev at mozilla.org
> https://mail.mozilla.org/listinfo/rust-dev
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://mail.mozilla.org/pipermail/rust-dev/attachments/20140417/6f37d780/attachment.html>


More information about the Rust-dev mailing list