Google's Rust Style Guide

24 points by kaycebasques


novedevo

I like to consider my Rust to be pretty stylish, but there are definitely recommendations here I could implement. For instance, I tend towards complicated iterator chains when a for loop is easier to read, and I'm guilty of putting iterator combinators in loop headers. I think I'm a point-free Haskeller at heart :)

I disagree with Google about crate size, though. Maybe it's more ergonomic with Google's internal build tooling, but with Cargo I would definitely rather crates contain more than a few .rs files if the complexity is warranted. To be fair, this section seems to only apply to Chrome, and I know nothing about their build system.

joshka

Similarly Microsoft's: https://microsoft.github.io/rust-guidelines/ And Ed Page's: https://epage.github.io/dev/rust-style/

citbl

Do they have a Go style guide? Or is it not required for Go?