Skip to content

Commit

Permalink
Make note that examples need a main()
Browse files Browse the repository at this point in the history
Fixes #19199
  • Loading branch information
steveklabnik committed Nov 25, 2014
1 parent 48ca6d1 commit d7b29a6
Showing 1 changed file with 7 additions and 1 deletion.
8 changes: 7 additions & 1 deletion src/doc/guide.md
Original file line number Diff line number Diff line change
Expand Up @@ -378,9 +378,15 @@ of your time with Rust.
The first thing we'll learn about are 'variable bindings.' They look like this:

```{rust}
let x = 5i;
fn main() {
let x = 5i;
}
```

Putting `fn main() {` in each example is a bit tedious, so we'll leave that out
in the future. If you're following along, make sure to edit your `main()`
function, rather than leaving it off. Otherwise, you'll get an error.

In many languages, this is called a 'variable.' But Rust's variable bindings
have a few tricks up their sleeves. Rust has a very powerful feature called
'pattern matching' that we'll get into detail with later, but the left
Expand Down

0 comments on commit d7b29a6

Please sign in to comment.