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. --- tests/hash.rs | 8 -------- 1 file changed, 8 deletions(-) (limited to 'tests/hash.rs') diff --git a/tests/hash.rs b/tests/hash.rs index 46ecdb4..32995ff 100644 --- a/tests/hash.rs +++ b/tests/hash.rs @@ -3,8 +3,6 @@ use std::collections::HashMap; use aur_build::db::model::Identity; use aur_build::hash; -/// A value that refuses to be serialized — the input the old implementation -/// answered with `"{}"`, a digest every failed value shared. struct Unserializable; impl serde::Serialize for Unserializable { @@ -17,15 +15,11 @@ impl serde::Serialize for Unserializable { fn a_value_that_cannot_be_serialized_is_an_error_not_an_empty_object() { let err = hash::canonical_json(&Unserializable).unwrap_err(); assert!(err.to_string().contains("cannot be serialized"), "the failure was swallowed: {err}"); - // Two different unserializable values now fail loudly instead of hashing to - // the same digest. assert!(hash::canonical_json(&Unserializable).is_err()); } #[test] fn the_rendering_is_canonical_in_fact_not_in_name() { - // Same fields, different declaration order: routed through `Value`, both come - // out with the keys sorted. #[derive(serde::Serialize)] struct Ab { alpha: String, @@ -41,7 +35,6 @@ fn the_rendering_is_canonical_in_fact_not_in_name() { assert_eq!(ab, ba, "field declaration order leaked into the rendering: {ab} vs {ba}"); assert_eq!(ab, r#"{"alpha":"1","beta":"2"}"#, "not the compact sorted rendering"); - // Same for a map assembled in an arbitrary order. let mut one = HashMap::new(); one.insert("z", 1); one.insert("m", 2); @@ -66,7 +59,6 @@ fn the_identity_digest_is_a_function_of_the_identity_alone() { let hash_of = |i: &Identity| i.hash().unwrap(); assert!(hash_of(&base).starts_with("sha256:")); assert_eq!(hash_of(&base), hash_of(&base.clone()), "the same identity hashed twice, twice differently"); - // Every element of the tuple is part of the key (§5.1a). assert_ne!(hash_of(&base), hash_of(&Identity { pkgrel: "2".into(), ..base.clone() })); assert_ne!(hash_of(&base), hash_of(&Identity { epoch: "1".into(), ..base.clone() })); assert_ne!(hash_of(&base), hash_of(&Identity { aur_commit: "cafe124".into(), ..base.clone() })); -- cgit v1.2.3