Lobsters | 📄 原文链接 | 2026-10-23 收录

Google 发布 Rust 风格指南:不只管格式,还管 API 设计

来源:google.github.io — 2026-10-21

📋 概述

Google 公开了内部使用的 Rust 风格指南,适用范围包括 google3、Android、ChromeOS、Fuchsia 与 Chrome。文档明确「style」不只指排版,还覆盖 API 与实现设计,目标是让跨代码库的 Rust 用法一致并立起质量基线。规则整体偏向可读性与可维护性,宁可写的时候多花点力气;对 async、标准库线程、Rc/Arc、glob 导入等都给了明确的取舍结论。

🔑 核心要点

💡 金句

Style rules should prioritize readability and maintainability over writeability.
← 返回 Lobsters 首页