Start 提交收录
Google Style Guides

Google Style Guides

google.github.ioDR 94 正常访问 300 浏览

开发编程 A collection of style guides for Google-originated open-source projects, including a detailed Rust Style Guide covering code organization, formatting, ownership, APIs, and error handling.

主编点评

仅供参考
Google Style Guides 页面预览

This is Google's official Rust style guide, offering opinionated rules on crate structure, imports, ownership, API design, and error reporting. It stands out for its practical, rationale-driven guidance aimed at large-scale codebases rather than beginner tutorials. Best for experienced Rust develope

站点介绍

Google Style Guides is a documentation site hosting coding conventions for open-source projects originating at Google. Among its guides, the Rust Style Guide defines how Rust code should be organized, formatted, and designed to remain consistent and maintainable across large codebases.

The guide covers code organization such as preferring small crates and flat file layouts, formatting and aesthetics, ownership and borrowing with advice to avoid Rc and Arc where possible, and API design covering flexible references, iterators versus owned collections, and preferring enums over booleans. It also addresses error reporting and trait implementation practices.

It is intended for Rust developers, especially those working in teams or on production systems, who want authoritative conventions beyond the compiler’s defaults. Readers should already be comfortable with Rust syntax and concepts like ownership and traits.

Use it as a reference when setting up linting and formatting rules, reviewing code, or designing public APIs. Note that some rules are marked as Chrome-specific, so not every guideline applies universally. Overall, it is a concise, practical standard for writing idiomatic, scalable Rust.

评论与评分

0

还没有评论,来写下第一条评价吧。

写下第一条评论

邮箱不会被公开,带 * 的为必填项。

为这个站点评分

点击星星打分,评分可选,再次点击已选星星可取消。