Conditional operation and boolean values in Rust

  1. Conditional: if
  2. Conditional: if - else
  3. Conditional: else - if
  4. Avoid the comparison chain using match
  5. Rust: boolean values true and false
  6. Assign result of conditional to variable
  7. Rust: other types don't have true/false values
  8. Toggle
  9. if-else returns a value
  10. Conditional (Ternary) operator
  11. match
  12. match all the numbers of an integer type
  13. match all the numbers of a float type
  14. match with conditions
  15. Exercise: one-dimensional space-fight.
  16. Solution: one-dimensional space-fight.