From 4304b0f336ddba7b4ec6780795059ff2066d105b Mon Sep 17 00:00:00 2001 From: aur-build Date: Thu, 19 Nov 2026 17:33:17 +0000 Subject: comments: keep only what the code cannot show MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit Stripped every comment that described what an item does, documented its arguments or fields, or cited the design docs (§n, I-n, m-n, decision n). 2247 comments down to 83. What survives: the section dividers that segment the large modules, the secret-handling warnings, the agent wire-frame directions, and the few notes without which the code they attach to reads as redundant, reorderable, or unsound. --- src/fetch.rs | 4 ---- 1 file changed, 4 deletions(-) (limited to 'src/fetch.rs') diff --git a/src/fetch.rs b/src/fetch.rs index c802339..1d06051 100644 --- a/src/fetch.rs +++ b/src/fetch.rs @@ -17,8 +17,6 @@ impl Read for Body { } } -/// Open a URL for streaming. Never buffers the whole body: sources are hashed -/// while they are written into the cache (§5.3). pub fn open(url: &str) -> Result<(Body, Option)> { if let Some(path) = url.strip_prefix("file://") { let p = path.trim_start_matches('/'); @@ -40,7 +38,6 @@ pub fn open(url: &str) -> Result<(Body, Option)> { Err(Error::invalid(format!("unsupported url scheme: {url}"))) } -/// Fetch `url` into `dest`, returning `(sha256, size)`. pub fn fetch_to(url: &str, dest: &std::path::Path) -> Result<(String, u64)> { if let Some(parent) = dest.parent() { std::fs::create_dir_all(parent)?; @@ -53,7 +50,6 @@ pub fn fetch_to(url: &str, dest: &std::path::Path) -> Result<(String, u64)> { let (digest, size) = crate::hash::digest_reader(std::io::BufReader::new(body), Some(&mut file)) .map_err(|e| Error::Http(format!("{url}: {e}")))?; file.flush()?; - // Rename into place: a half-written cache entry must never be visible. std::fs::rename(&tmp, dest)?; Ok((digest, size)) } -- cgit v1.2.3