3 ms·
One interesting thing you couldn't practically have done twenty years ago but became relatively straightforward for a project which is Free Software anyway in t
by tialaramex 5y ago
One interesting thing you couldn't practically have done twenty years ago but became relatively straightforward for a project which is Free Software anyway in the modern era is to literally link the source code from the documentation.
Take Rust's std::iter::repeat_with
https://doc.rust-lang.org/std/iter/fn.repeat_with.html https://doc.rust-lang.org/std/iter/fn.repeat_with.html
There's a declaration of this standard library function to make an iterator from a closure, then there's a working code sample which uses it and a further example showing a closer to real-world usage.
But top-right is a [src] link, you can go in one click from the documentation of the function call, to the actual implementation which is used (except where Rust just says this is a compiler intrinsic and then you need to burrow into the details of the actual compiler).