Examples
There are some things that I consider to be part of documentation even though technically, they are not documentation. These are unit tests and examples.
Reading
Add examples to your Rust libraries (archived) by Karol Kuczmarski
Karol explains the need for working examples when using an unfamiliar
library, and how Rust supports this out-of-the-box with its support for
examples. Karol explains that Rust treats examples as documentation, and builds
them when you run cargo test
. Karol argues that all Rust projects should come
with good examples, because they make using the code easier and help people get
started.