phylum-dev / rust-style-guidelines

Rust code style guidelines

Geek Repo:Geek Repo

Github PK Tool:Github PK Tool

Rust Style Guidelines

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.

Other resources

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:

Table of Contents

  1. Rustfmt
  2. Clippy
  3. Comments
  4. Imports
  5. Ordering
  6. Naming
  7. Error Handling
  8. Macros
  9. Tests
  10. Enums
  11. Structs
  12. Control Flow
  13. Functions
  14. Visibility

Contributing

If you wish to contribute a new rule, please use the SKELETON.md as a structural guideline.

License

MIT - with complete text available in the LICENSE file.

About

Rust code style guidelines

License:MIT License