rust-best-practices
Rust Best Practices
Apply these guidelines when writing or reviewing Rust code. Based on Apollo GraphQL's Rust Best Practices Handbook.
Shared module design
Use codebase-design for language-independent conventions: group by domain then role where useful, keep related implementation together, and expose complete operations. Extract only for hidden complexity or useful reuse; define each contract once, convert execution models at external boundaries, and own required work through completion. Keep configured line limits with documented narrow exceptions. Comments explain reasons and invariants; tests verify public behavior with as many assertions as that behavior needs. Apply the upstream chapters below within these conventions; private visibility is not a reason to test implementation details.
Best Practices Reference
Before reviewing, familiarize yourself with Apollo's Rust best practices. Read ALL relevant chapters in the same turn in parallel. Reference these files when providing feedback: