diff options
| author | aur-build <aur-build@localhost> | 2026-11-19 17:09:59 +0000 |
|---|---|---|
| committer | aur-build <aur-build@localhost> | 2026-11-19 17:09:59 +0000 |
| commit | e757979f1a2afdbe7146066345bb9acd19d3b151 (patch) | |
| tree | 30d5f5fbccd25ea7bf01c5202684af463b74e7d3 /src/http/routes | |
| parent | 94c318f13264bb3c00a9f3057ba2e1aafb57c9e4 (diff) | |
| download | aur-build-e757979f1a2afdbe7146066345bb9acd19d3b151.tar.gz aur-build-e757979f1a2afdbe7146066345bb9acd19d3b151.zip | |
comments: say why, not what
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.
Diffstat (limited to 'src/http/routes')
| -rw-r--r-- | src/http/routes/mod.rs | 6 | ||||
| -rw-r--r-- | src/http/routes/mutations.rs | 3 | ||||
| -rw-r--r-- | src/http/routes/pages.rs | 9 |
3 files changed, 3 insertions, 15 deletions
diff --git a/src/http/routes/mod.rs b/src/http/routes/mod.rs index e78cc74..0dfed52 100644 --- a/src/http/routes/mod.rs +++ b/src/http/routes/mod.rs @@ -1,9 +1,3 @@ -//! Route handlers (§12). -//! -//! Every handler reads through `db.read` — the thread-local read-only -//! connection — and hands mutations to the writer actor. A slow client can -//! therefore never hold the write lock, which is the whole point of the split. - use crate::db::{self, builds, model::*}; use crate::review::candidates; use crate::time; diff --git a/src/http/routes/mutations.rs b/src/http/routes/mutations.rs index 133d491..79089b2 100644 --- a/src/http/routes/mutations.rs +++ b/src/http/routes/mutations.rs @@ -1,6 +1,3 @@ -//! The write side of the UI: every handler that changes something, and the flash -//! it answers with. - use crate::db::{self, builds}; use crate::review::{approve as ap, candidates}; use crate::pipeline; diff --git a/src/http/routes/pages.rs b/src/http/routes/pages.rs index dea7de0..f1f3ef8 100644 --- a/src/http/routes/pages.rs +++ b/src/http/routes/pages.rs @@ -1,5 +1,3 @@ -//! The read side of the UI: pages that only ever go through `db.read`. - use crate::db::{self, builds, Db}; use crate::review::{candidates, diff, risk}; use crate::ops; @@ -554,10 +552,9 @@ pub(crate) fn audit(state: &State, req: &Req) -> Res { /// `GET /metrics` in Prometheus text exposition format (§12, §15). /// -/// Everything here is computed from live state on every scrape. There are no -/// counters incremented at event sites, because a counter that has to be -/// maintained by every code path is a counter that quietly drifts the first time -/// a path is added; a query cannot drift. +/// Everything here is computed from live state on every scrape. There are no counters +/// incremented at event sites: a counter every code path has to maintain quietly +/// drifts the first time a path is added; a query cannot drift. pub fn metrics(state: &State) -> Res { match ops::metrics(&state.cfg, &state.db) { Ok(m) => { |
