How to measure code coverage

Use the external cargo-tarpaulin tool to generate an HTML report showing which lines of Rust code are executed by your tests.

Rust does not have a built-in command to measure code coverage; you must use the cargo-tarpaulin tool. Install it and run it with the --out flag to generate an HTML report in your project directory.

cargo install cargo-tarpaulin
cargo tarpaulin --out Html

Open the generated tarpaulin-report.html file in your browser to see the coverage details.