You can use cfg(debug_assertions) but there should probably be a cfg(debug).
Related topics
| Topic | Replies | Views | Activity | |
|---|---|---|---|---|
| How do I execute code based on the build type (release or debug) | 3 | 336 | August 20, 2025 | |
| Conditional compilation | 4 | 677 | September 24, 2020 | |
| Cfg annotation for debugging | 5 | 736 | May 22, 2025 | |
| Conditional Compilation if unoptimized | 3 | 672 | March 30, 2019 | |
|
`debug_assert` and trivial conditions: `#[cfg(...)]` vs `cfg!(...)`
|
4 | 2128 | November 11, 2018 |