@pranshurastogi
#day5ofRust
In Rust, if the last expression in a function doesn't have a semicolon, it's implicitly returned. However, a for loop itself doesn't evaluate to a value; it's a statement that performs actions. If your function ends with a for loop, Rust sees the loop as the last "thing," and since the loop doesn't return a value, it evaluates to (), the "unit type" (similar to void in other languages).