Logo

Programming-Idioms

History of Idiom 123 > diff from v31 to v32

Edit summary for version 32 by programming-idioms.org:
[Rust] +DemoURL

Version 31

2021-03-26, 18:28:28

Version 32

2021-03-26, 18:31:45

Idiom #123 Assert condition

Verify that predicate isConsistent returns true, otherwise report assertion violation.
Explain if the assertion is executed even in production environment or not.

Idiom #123 Assert condition

Verify that predicate isConsistent returns true, otherwise report assertion violation.
Explain if the assertion is executed even in production environment or not.

Variables
isConsistent
Variables
isConsistent
Extra Keywords
debug testing test
Extra Keywords
debug testing test
Code
assert!(isConsistent);
Code
assert!(is_consistent);
Doc URL
https://doc.rust-lang.org/std/macro.assert.html
Doc URL
https://doc.rust-lang.org/std/macro.assert.html
Demo URL
https://play.rust-lang.org/?version=stable&mode=debug&edition=2018&gist=b376cfd68c4d846b92338918488ebd2c