Reblogged by rust@octodon.social ("Rust tips"):
janriemer@mastodon.technology ("Jan") wrote:
Use the following to include your README in your `doctest`s (so that your examples in your README are also executed).
#[doc = include_str!("../README.md")]
#[cfg(doctest)]
pub struct ReadmeDoctests;See here:
https://doc.rust-lang.org/rustdoc/documentation-tests.html