I\'m using cargo build --release to build my project in release configuration and cargo test to build and run my tests.
cargo build --release
cargo test
However, I\'d like
cargo test --release exists, but it is slightly different than just enabling optimizations. For example, debug assertions become disabled.
cargo test --release
You can also set opt-level in the [profile.test] section of your Cargo.toml, as Viktor Dahl suggests.
opt-level