Google's Rust Style Guide
Web page · https://google.github.io/styleguide/rustguide.html
First seen by Oriel on .
AI summary
Google’s Rust Style Guide combines formatting, API design, and implementation guidance to improve readability, maintainability, consistency, and support for large-scale code changes.
- It advises following public Rust style rules unless they conflict with this guide, and treats API-design rules as binding for libraries but recommendations for application code.
- For Chromium, it favors small crates and requires source files for one rust_library to remain in a single directory; oversized crates should generally be split.
- It discourages glob imports, recommends importing items from one module per use statement, and distinguishes conventions for importing functions versus types.
- The guide prioritizes direct, problem-focused application code while encouraging refactor-friendly patterns that make tooling-assisted changes easier across large codebases.
#rust #api design #code organization
Generated by gpt-5.6-sol. Check the original for details.
Metric trends
Last 30 days · Up to 120 recorded samples per source and metric, with reposts kept separate · First and latest retained
Points
Score reported by the source.
- Hacker News: 382, latest observation ; +361 over observed period since
- Lobsters: 51, latest observation ; +48 over observed period since
Comments
Comment count reported by the source.
- Hacker News: 251, latest observation ; +246 over observed period since
- Lobsters: 17, latest observation ; +17 over observed period since
Aliases
| Source | External ID | URL |
|---|---|---|
| Hacker News | 50186010 | https://google.github.io/styleguide/rustguide.html Read discussion |
| Lobsters | 9jgl3x | https://google.github.io/styleguide/rustguide.html Read discussion |