{
  "id": 15942680,
  "title": "Google's Rust Style Guide",
  "url": "https://urgent.news/2026/10/21/googles-rust-style-guide",
  "topic": "tech",
  "section": "Tech",
  "published": "2026-10-21T19:11:57.000Z",
  "source": {
    "name": "Hacker News",
    "slug": "hacker-news",
    "url": "https://google.github.io/styleguide/rustguide.html"
  },
  "original_language": "en",
  "account": "This style guide outlines the guidelines for using the Rust programming language at Google. Rust is used in various Google codebases such as google3, Android, ChromeOS, Fuchsia, and Chrome. The goal is to maintain consistency in Rust usage across different codebases and improve code readability. The style guide shares the three common goals of other style guides: consistency, readability, and encouraging good API design. An additional goal is to make it easier for Large-Scale Changes (LSCs) by promoting deliberate refactor-friendly patterns.\n\nFor library code, style guide rules concerning API design are binding. For application code, the rules on API design are a strong recommendation, with a focus on simplicity and directness over broad reusability. Avoid premature generalization and abstraction, and focus on meeting immediate needs.\n\nIn Chromium, it is preferred not to split modules across files. Small crates, ideally single-file crates focused on one abstraction, are recommended. If using submodules, follow the expected file structure. However, larger crates with trait impl coherence rules or foundational libraries are allowed.\n\nFiles belonging to a single rust_library (Rust crate) must reside in a single directory. Avoid using subdirectories to organize files within a single crate. If organizing files in subdirectories seems necessary, it indicates the crate has grown too large and should be split. This approach differs from the conventional Cargo directory structure used in open-source repositories. For Rust code in //third_party that is also built with Cargo, the conventional Cargo directory structure should be followed.",
  "summary": null,
  "key_points": [],
  "editors_take": null,
  "illustration": null,
  "coverage": {
    "outlets": 2,
    "also_reported_by": [
      {
        "outlet": "Lobsters",
        "title": "Google's Rust Style Guide",
        "url": "https://urgent.news/2026/10/21/googles-rust-style-guide-15947405",
        "published": "2026-10-21T19:12:02.000Z"
      }
    ]
  },
  "ai_generated": true,
  "disclaimer": "Summaries, key points and the editor’s take are written by software from other outlets’ reporting and may contain errors — always check the linked original."
}