Assertions
We can do more than simply print out bool
s. One example is the assert!
macro, which makes sure that the program doesn’t continue executing unless something is true. For example, let’s write a program to make sure we know how to do math correctly:
Get hands-on with 1400+ tech skills courses.