3 ms·
> Guys, we have the canonical way all Rust code should look from the Rust compiler itself. The Rust compiler is in many different 'dialects' of Rust, since it
by steveklabnik 14y ago
> Guys, we have the canonical way all Rust code should look from the Rust compiler itself.
The Rust compiler is in many different 'dialects' of Rust, since it's been around for so long. Parts of it haven't been touched in a while.
We're working on a general style guide here: https://github.com/mozilla/rust/wiki/Note-style-guide https://github.com/mozilla/rust/wiki/Note-style-guide
- coldtea 14y ago>We're working on a general style guide here: https://github.com/mozilla/rust/wiki/Note-style-guide* https://github.com/mozilla/rust/wiki/Note-style-guide* Better than that would be a goftm like tool, that applies the style guide. People (including me) love that about Go. (I've actually never read a negative comment about it and many possitives). It puts an end to all issues with formatting, really. I don't know how reusable the parse is -- it would make something like this even easier.
- kibwen 14y agoThere exists one of these built into the Rust compiler, but it's not very good right now. The process of creating an "official" style guide as per the above wiki page might help build the momentum needed to actually make the pretty printer usable.
- steveklabnik 14y agoPlease see my comment upthread about rustc --pretty. You can't figure out what a pretty printer should pretty print until the style is figured out.