Skip Doctests When Running cargo test

March 2023

I don't use doctests when I'm working on small, one-off Rust apps. The default functionality of cargo test it so run them. The result is an empty report that shows up last. It's no big deal but it throws me off seeing 0 passed in the report.

I use this in my cargo.toml file to turn off the tests and the subsequent report:

[lib]
doctest = false

It's a nice little quality of live improvement when you don't have doctests to run.

end of line