Conceptual
Login

Formatting Rust Kernel Code with rustfmt

rustfmt rewrites Rust source into one agreed layout, so nobody argues about indentation or line breaks. The kernel provides commands to reformat its Rust files or to check that they are already formatted. Submitting unformatted code is an immediate and pointless review comment. Letting the tool decide frees you to think about the driver instead.

Questions this Concept answers

  • Why does the kernel prefer a tool to decide Rust formatting rather than leaving it to authors?