Hacker News new | ask | show | jobs
by goldfire 3033 days ago
Rust's library documentation has this feature as well; each item has a [src] link that takes you straight to the code being documented; see for instance [0], and you'll find the link to the right side of the heading. This even works for crates not in the standard library because it's actually a feature provided by rustdoc, the standard documentation generator; for example, you can get to the source for functions in serde (the most popular Rust serialization library) directly from its documentation [1].

[0] https://doc.rust-lang.org/std/vec/struct.Vec.html#method.tru...

[1] https://docs.serde.rs/serde_json/ser/fn.to_string_pretty.htm...