Chromium Rust Style Guide

For other languages, please see the Chromium style guides.

Chromium follows the upstream Rust Style Guide. The style is enforced by git cl format and configured by //.rustfmt.toml.

FAQ

Q: How to improve my Gerrit experience?

Rust Style Guide allows up to 100-characters-wide lines (just like Java). If Gerrit is configured for 80-characters-wide lines, it can lead to a suboptimal user experience. This can be resolved by changing Gerrit settings (e.g. at https://chromium-review.googlesource.com/settings) as follows:

  • Diff Preferences => Diff width: 101
  • Edit Preferences => Columns: 100