Skip to content

Commit df0c6be

Browse files
committed
docs(codegen): trim FrontPageExample's doc comments to the load-bearing half
Cut the struct's refactor rationale, as_doc's restatement of its own last line, and a label on EXAMPLE_QUICK_START. The field contracts, use_line's rustfmt note and the two "keep this assertion" notes stay. Comment-only -- regenerating moves nothing. Claude-Session: https://claude.ai/code/session_01Jvd5LRrC13xzGGeFPgVpmP
1 parent 403f56b commit df0c6be

1 file changed

Lines changed: 1 addition & 12 deletions

File tree

ta_codegen/generator/src/main.rs

Lines changed: 1 addition & 12 deletions
Original file line numberDiff line numberDiff line change
@@ -2317,14 +2317,6 @@ fn sync_pom_indicator_count(root: &Path, n_funcs: usize) {
23172317

23182318
/// A Rust sample that both crate front pages carry -- the `lib.rs` crate docs
23192319
/// and `README.md`.
2320-
///
2321-
/// The two pages render differently and always will: one is rustdoc with
2322-
/// intra-doc links, the other is Markdown that has to stand on crates.io. What
2323-
/// they have no business differing on is the CODE, which is the same claim
2324-
/// about the same API made twice, compiled on two separate paths (`cargo test
2325-
/// --doc` for the module docs, `ReadmeExamples` for the README). Two copies of
2326-
/// a claim is one copy that can go quietly wrong, so the body is authored once
2327-
/// here and the wrapper each page needs is added on the way out (#179 D5).
23282320
struct FrontPageExample {
23292321
/// The crate items the body names. The README rendering appends `RetCode`
23302322
/// for its `fn main` signature, so leave it out unless the body itself
@@ -2345,9 +2337,7 @@ impl FrontPageExample {
23452337
}
23462338
}
23472339

2348-
/// The `//!`-prefixed doctest for `lib.rs`. Runs the body bare and closes
2349-
/// with the type-annotated `Ok` that gives `?` something to return to --
2350-
/// hidden with `#`, so the reader sees only the call.
2340+
/// The `//!`-prefixed doctest for `lib.rs`.
23512341
fn as_doc(&self) -> String {
23522342
let mut out = String::from("//! ```\n");
23532343
for line in [Self::use_line(self.uses), String::new()]
@@ -2391,7 +2381,6 @@ impl FrontPageExample {
23912381
}
23922382
}
23932383

2394-
/// The batch call: the first thing either page shows.
23952384
const EXAMPLE_QUICK_START: FrontPageExample = FrontPageExample {
23962385
uses: &["Core", "RetCode"],
23972386
body: r#"let close = [11.0, 12.0, 13.0, 14.0, 15.0, 16.0, 17.0, 18.0, 19.0, 20.0];

0 commit comments

Comments
 (0)