79115147

Date: 2024-10-22 17:14:16
Score: 0.5
Natty:
Report link

I use this code and it compiles and runs in debug mode. If thing_initialized is true, it executes. If false, this is gets a runtime error.

fn main() {
    #[cfg(debug_assertions)]
    let thing_initialized = false;
    
    if cfg!(debug_assertions) {
        assert!(thing_initialized);
    }
}
Reasons:
  • Low length (0.5):
  • Has code block (-0.5):
  • Low reputation (0.5):
Posted by: vadtam