Code formatting guideline#
This document provides code formatting rules that should be enforced for new code.
General#
G-01: Format code ascargo fmtdoes.G-02: Ifcargo fmtdoes not enforce anything at all (e.g., macros), try format to format it in a rusty way.G-03: Try to avoid overly long lines even ifcargo fmtdoes not complain.
Imports#
I-01: Always put external imports (including sibling crates) first, in alphabetical order, followed by crate-internal imports (crate::) and, afterwards, relative imports.I-02: Group all imports from the same crate into a block (alphabetically ordered) that is separated from other blocks with an empty line.I-03: Always useself::orsuper::for relative imports.