The rustc-approved way to check code coverage in Rust is long and arduous. In my view, it's just too technical for most users to be comfy using it.

A simpler way

Here's an easier way to check codecov in your Rust workspace:

  1. Install cargo-binstall
  2. Use that to get cargo-tarpaulin
  3. Run it to check code coverage in your project
# install cargo-binstall
$ curl -L --proto '=https' --tlsv1.2 -sSf https://raw.githubusercontent.com/cargo-bins/cargo-binstall/main/install-from-binstall-release.sh | bash

# get cargo-tarpaulin
$ cargo tarpaulin --engine llvm --out Html

# cd to your project
$ cd my_project

# run cargo-tarpaulin.
#
# note: you can remove `--out Html` if you just want some percentages
~/my_project $ cargo tarpaulin --engine llvm --out Html

That'll generate a file called tarpaulin-report.html in the root of your workspace. You can open it using a web browser to take a look:

A screenshot of the cargo-tarpaulin output HTML from my project, raves-metadata.

You can click on the crates/files to view more information about the exact coverage.

Go Home