[Rust Guide] 3.5. Control Flow - if else
3.5.0. Before the Main Content Welcome to Chapter 3 of Rust self-study. There are 6 sections in total: Variables and Mutability Data Types: Scalar Types Data Types: Compound Types Functions and Com...
![[Rust Guide] 3.5. Control Flow - if else](https://media2.dev.to/dynamic/image/width=1200,height=627,fit=cover,gravity=auto,format=auto/https%3A%2F%2Fdev-to-uploads.s3.amazonaws.com%2Fuploads%2Farticles%2Fnbgytrk2ls0eukjumpzm.png)
Source: DEV Community
3.5.0. Before the Main Content Welcome to Chapter 3 of Rust self-study. There are 6 sections in total: Variables and Mutability Data Types: Scalar Types Data Types: Compound Types Functions and Comments Control Flow: if else (this article) Control Flow: Loops Through the small game in Chapter 2 (strongly recommended for beginners who haven't read it), you should already understand the basic syntax of Rust. In Chapter 3, we will go deeper and learn general programming concepts in Rust. If you like it, remember to like, bookmark, and follow. Follow the series if you want to keep learning. 3.5.1. Basic Understanding of if Expressions The if expression allows executing different code branches based on a condition The condition must be a boolean type. This is different from Ruby, JavaScript, and C++, which automatically convert non-boolean values to boolean The condition can be a literal, an expression, or a variable In an if expression, the code associated with each condition is called a b