Assertions

We can do more than simply print out bools. 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.