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 | 474 | August 20, 2025 | |
| Conditional compilation | 4 | 767 | September 24, 2020 | |
| Cfg annotation for debugging | 5 | 934 | May 22, 2025 | |
| Conditional Compilation if unoptimized | 3 | 739 | March 30, 2019 | |
|
`debug_assert` and trivial conditions: `#[cfg(...)]` vs `cfg!(...)`
|
4 | 2219 | November 11, 2018 |