Replace assert! with debug_assert! in production code paths.
This allows the assertions to be disabled in release builds, so that the code is faster and smaller, at the expense of not performing the checks. Assertions can be re-enabled in release builds with the debug-assertions flag in Cargo.toml, as the top-level Cargo.toml file does.
This commit is contained in:
@@ -187,7 +187,7 @@ mod details {
|
||||
let duration = self.start.elapsed();
|
||||
dbg!("timing: Ending {}", self.pass);
|
||||
let old_cur = CURRENT_PASS.with(|p| p.replace(self.prev));
|
||||
assert_eq!(self.pass, old_cur, "Timing tokens dropped out of order");
|
||||
debug_assert_eq!(self.pass, old_cur, "Timing tokens dropped out of order");
|
||||
PASS_TIME.with(|rc| {
|
||||
let mut table = rc.borrow_mut();
|
||||
table.pass[self.pass.idx()].total += duration;
|
||||
|
||||
Reference in New Issue
Block a user