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/urlutil.rs | 11 ++--------- 1 file changed, 2 insertions(+), 9 deletions(-) (limited to 'src/urlutil.rs') diff --git a/src/urlutil.rs b/src/urlutil.rs index 75b52b9..51def16 100644 --- a/src/urlutil.rs +++ b/src/urlutil.rs @@ -1,17 +1,10 @@ -//! Source-URL questions that more than one module asks (§6 m-2). -//! -//! `review::diff` and `review::risk` each carried a verbatim copy of `hosts`, -//! which is the kind of duplication that stays harmless until one copy is fixed -//! and the other is not: the diff panel would tell a reviewer a host appeared -//! while the risk scorer stayed quiet about the same host. - use std::collections::BTreeSet; /// The host of one `source=()` entry, or `None` when it names no host — a local /// file, a relative path, or a `file://` URL. /// -/// Handles the two prefixes a PKGBUILD puts in front of a URL: a `custom::` -/// filename prefix, and the `git+`/`svn+`/`npm+` VCS scheme prefix. +/// Handles the `custom::` and `git+`/`svn+`/`npm+` prefixes a PKGBUILD puts before a +/// URL. pub fn host_of(source: &str) -> Option { let s = source.rsplit("::").next().unwrap_or(source); let s = s.rsplit('+').next().unwrap_or(s); -- cgit v1.2.3