Control Flow
์์์ ์ดํด๋ณธ ๋ฐ์ ๊ฐ์ด ๋ฌ์คํธ์ ํํ์์ผ๋ก์จ if
๋ ๋ ๋ธ๋ก ์ค ํ๋๋ฅผ ์กฐ๊ฑด์ ๋ฐ๋ผ ํ๊ฐ(๋ฐํ)ํ๋ฉฐ, ๋ธ๋ก์ if
ํํ์์ ๊ฐ์ด ๋๋ ๊ฐ์ ๊ฐ์ง ์ ์์ต๋๋ค. ๋ค๋ฅธ ํ๋ฆ์ ์ด ํํ์๋ ๋ฌ์คํธ์์ ์ ์ฌํ๊ฒ ์๋ํฉ๋๋ค.
As we have seen,
if
is an expression in Rust. It is used to conditionally evaluate one of two blocks, but the blocks can have a value which then becomes the value of theif
expression. Other control flow expressions work similarly in Rust.