sensible-dbg 0.1.1

Fork of the std::dbg macro that has no effect on release builds.
Documentation
  • Coverage
  • 0%
    0 out of 2 items documented0 out of 1 items with examples
  • Size
  • Source code size: 3.23 kB This is the summed size of all the files inside the crates.io package for this release.
  • Documentation size: 234.89 kB This is the summed size of all files generated by rustdoc for all configured targets
  • Ø build duration
  • this release: 9s Average build duration of successful builds.
  • all releases: 9s Average build duration of successful builds in releases after 2024-10-23.
  • Links
  • cauebs/sensible-dbg
    3 0 0
  • crates.io
  • Dependencies
  • Versions
  • Owners
  • cauebs

sensible-dbg

If you read the discussion on std's new dbg! macro, you'll find that there are good reasons why it shouldn't affect release builds. As a silent protest against the decision, I made my own version.

Usage

use sensible_dbg::dbg;

fn factorial(n: u32) -> u32 {
    if dbg!(n <= 1) {
        dbg!(1)
    } else {
        dbg!(n * factorial(n - 1))
    }
}