From e757979f1a2afdbe7146066345bb9acd19d3b151 Mon Sep 17 00:00:00 2001 From: aur-build Date: Thu, 19 Nov 2026 17:09:59 +0000 Subject: comments: say why, not what MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Every module-level `//!` header is gone, and the comments that remained either re-explained the line below them or had grown into paragraphs. Density went from one comment line per 6.7 lines of code to one per 10. 827 insertions against 2194 deletions across 86 files. What survived: the invariants (I1-I12), the design cross-references into DESIGN.md, and the notes recording a bug that was found and fixed — those are the comments that carry weight, because they answer a question the code cannot answer about itself. What did not: restating a function signature in prose, and narration of the statement underneath. --- src/pkginfo.rs | 18 +----------------- 1 file changed, 1 insertion(+), 17 deletions(-) (limited to 'src/pkginfo.rs') diff --git a/src/pkginfo.rs b/src/pkginfo.rs index 7ec8b83..be0aeb6 100644 --- a/src/pkginfo.rs +++ b/src/pkginfo.rs @@ -1,17 +1,3 @@ -//! Reading `.PKGINFO` and `.BUILDINFO` out of a package archive (§10.1). -//! -//! A `.pkg.tar.zst` is a zstd-compressed tar with two plain-text metadata files -//! inside it. pacman reads these through libalpm; we do not link libalpm (no -//! FFI, no C toolchain dependency, §14), so this module parses the tar and the -//! text directly. That is not a shortcut — the format is a `key = value` file -//! with repeated keys, and a `.BUILDINFO` `installed =` block of -//! `name version arch signature` lines. Both are stable and documented, and -//! parsing them here is roughly eighty lines. -//! -//! This is production code, not harness code: the ingest step decides what the -//! index claims about a package, and what the world snapshot records, by reading -//! these two files. - use std::io::Read; /// A package's own metadata, as `.PKGINFO` states it. @@ -97,9 +83,7 @@ pub fn parse_pkginfo(text: &str) -> PkgInfo { /// Parse the `.BUILDINFO` `installed` block. /// /// The first entry shares the line with the key — `installed = glibc 2.39-1 -/// x86_64 -` — and the rest are indented under it, so the header line has to be -/// parsed as well as skipped. Dropping it would silently lose one dependency from -/// every snapshot, which is exactly the kind of gap that makes staleness lie. +/// x86_64 -` — so the header line has to be parsed as well as skipped. pub fn parse_installed(text: &str) -> Vec { let mut out = Vec::new(); let mut in_block = false; -- cgit v1.2.3