Fix indentation in code block example

pull/145/head
Phoenix Eliot 2 years ago committed by GitHub
parent 6dbd58b1fe
commit 100608a9a4
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23

@ -638,7 +638,7 @@ You can use a code block to return a value:
```rust
fn main() {
let my_number = {
let second_number = 8;
let second_number = 8;
second_number + 9 // No semicolon, so the code block returns 8 + 9.
// It works just like a function
};
@ -652,7 +652,7 @@ If you add a semicolon inside the block, it will return `()` (nothing):
```rust
fn main() {
let my_number = {
let second_number = 8; // declare second_number,
let second_number = 8; // declare second_number,
second_number + 9; // add 9 to second_number
// but we didn't return it!
// second_number dies now

Loading…
Cancel
Save