This project aims at providing a guideline for writing consistent Rust code, to reduce review friction and help new developers.
This is not a complete collection of all Rust style guidelines. If there are any style conflicts not clarified by this repository, please open an issue.
There are numerous other resources which focus on de-facto standards in the Rust community. Unless otherwise specified, these common guidelines should be applied to all Rust code.
Notable examples:
- https://rust-lang.github.io/api-guidelines
- https://deterministic.space/elegant-apis-in-rust.html
- https://rust-unofficial.github.io/patterns
- Rustfmt
- Clippy
- Comments
- Imports
- Ordering
- Naming
- Error Handling
- Macros
- Tests
- Enums
- Structs
- Control Flow
- Functions
- Visibility
If you wish to contribute a new rule, please use the SKELETON.md
as a
structural guideline.
MIT - with complete text available in the LICENSE file.