Skip to content

Fork of the std::dbg macro that has no effect on release builds.

License

Notifications You must be signed in to change notification settings

cauebs/sensible-dbg

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

2 Commits
 
 
 
 
 
 
 
 
 
 

Repository files navigation

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))
    }
}

About

Fork of the std::dbg macro that has no effect on release builds.

Resources

License

Stars

Watchers

Forks

Languages