Rust TutorialLesson 11Free preview
Rust Booleans
This lesson is part of Rust · All levels
Summary
This lesson delimits the boolean data type on Rust that has only two possible values: true or false. This type of boolean becomes the foundation for all decision-making logic in the if-else control structure and repetition. The developer will learn how to evaluate the expression of a condition properly.
Key points
- The boolean data type is expressed by the keyword 'bool'
- Only two values are valid: 'true' and 'false'
- Bool type is 1 byte in memory
- The condition on the statement if must be of the bool type strictly without implicit conversion of the integer
Full lesson
Code examples and quizzes
Full lessons, code examples, and quizzes are available to subscribers. 5 questions.