Skip to content

Commit 581f5a4

Browse files
authored
Update blocks.md (#235)
Adding the important note about ";" in blocks.
1 parent 5675756 commit 581f5a4

File tree

1 file changed

+2
-0
lines changed

1 file changed

+2
-0
lines changed

src/control-flow/blocks.md

Lines changed: 2 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -34,3 +34,5 @@ fn main() {
3434
println!("doubled: {}", double(7));
3535
}
3636
```
37+
38+
However if the last expression ends with `;`, then the resulting value and type is `()`.

0 commit comments

Comments
 (0)