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/render.rs | |
| 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/render.rs')
| -rw-r--r-- | src/http/render.rs | 14 |
1 files changed, 2 insertions, 12 deletions
diff --git a/src/http/render.rs b/src/http/render.rs index ca3ba51..f049a25 100644 --- a/src/http/render.rs +++ b/src/http/render.rs @@ -1,9 +1,3 @@ -//! Template contexts (§12, §13). -//! -//! Askama compiles every template into Rust at build time, so a missing field -//! is a compile error rather than a blank page at 2am. Contexts are built from -//! live DB state; nothing here writes. - use askama::Template; /// Everything the shared chrome needs. Embedded in each page context because @@ -293,8 +287,7 @@ pub struct Builds { pub recent: Vec<BuildRow>, } -/// The same table on its own, for the htmx fragment refresh. Same fields, so -/// the include in builds.html and this standalone render cannot drift apart. +/// The same table on its own, for the htmx fragment refresh. #[derive(Template)] #[template(path = "builds_table.html")] pub struct BuildsTable { @@ -386,13 +379,10 @@ pub struct SettingRow { pub value: String, } -/// Vendored static assets. htmx arrives in P3; until then this serves the -/// favicon and refuses everything else rather than walking the filesystem. /// Static assets. Two files, both vendored, both served from `include_bytes!` /// so the binary is self-contained and there is no install step and no bundler /// (§13). htmx is the only JavaScript this app ships; it is served precompressed -/// because the raw file is 48 KB and the gzip is 15 KB, and the budget that -/// matters is what a browser actually downloads. +/// because the budget that matters is what a browser actually downloads. pub fn static_asset(name: &str, accept_gzip: bool) -> crate::http::Res { use crate::http::Res; match name { |
