Language Items
This section covers conventions for specific Rust language constructs. Each page addresses one category with actionable guidelines.
- Variables, Expressions, and Statements — Explaining variables, block expressions, and checked arithmetic.
- Functions and Methods — Nesting control, function focus, and boolean-argument avoidance.
- Types and Traits — Type-level invariants, closed-set modeling, and field encapsulation.
- Comments and Documentation — Rustdoc conventions, punctuation/readability, and module docs.
- Unsafety —
// SAFETY:comments,# Safetysections, and module-boundary audits. - Modules and Crates — Visibility and dependency policy.
- Macros and Attributes — Lint suppression scope, dead-code expectations, and macro restraint.