sensible-dbg

Crates.iosensible-dbg
lib.rssensible-dbg
version0.1.1
sourcesrc
created_at2019-01-18 00:29:39.257326
updated_at2019-01-18 00:46:52.280778
descriptionFork of the std::dbg macro that has no effect on release builds.
homepage
repositoryhttps://github.com/cauebs/sensible-dbg
max_upload_size
id109246
size3,238
CauĂȘ Baasch de Souza (cauebs)

documentation

README

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))
    }
}
Commit count: 2

cargo fmt