# rustfmt.toml

Put this file at your repository root and run `cargo +nightly fmt`. Stable rustfmt applies `max_width` and skips the three nightly-only options with a warning.

[Download rustfmt.toml](/Google-Rust-Style-Guide/files/rustfmt.toml)

```toml title="rustfmt.toml"
# Formatting options named by the Google Rust style guide.
# https://google.github.io/styleguide/rustguide.html#use-the-appropriate-formatting-tool

max_width = 100

# The options below are unstable. Stable rustfmt prints a warning and skips them,
# so run `cargo +nightly fmt` to apply the full configuration.
hex_literal_case = "Lower"
format_macro_matchers = true

# One `use` statement per module, with no nested `::` inside `{..}`.
# https://google.github.io/styleguide/rustguide.html#a-use-statement-should-import-items-from-one-module
imports_granularity = "Module"
```

Source: [`rustfmt.toml` on GitHub](https://github.com/DaniAkash/Google-Rust-Style-Guide/blob/main/rustfmt.toml). New to the kit? Start with the [quick start](/Google-Rust-Style-Guide/quick-start/).