Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Minor changes to variable bindings chapter #34094

Merged
merged 1 commit into from
Jun 7, 2016
Merged
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
13 changes: 7 additions & 6 deletions src/doc/book/variable-bindings.md
Original file line number Diff line number Diff line change
Expand Up @@ -37,8 +37,8 @@ of our minds as we go forward.
Rust is a statically typed language, which means that we specify our types up
front, and they’re checked at compile time. So why does our first example
compile? Well, Rust has this thing called ‘type inference’. If it can figure
out what the type of something is, Rust doesn’t require you to actually type it
out.
out what the type of something is, Rust doesn’t require you to explicitly type
it out.

We can add the type if we want to, though. Types come after a colon (`:`):

Expand Down Expand Up @@ -159,8 +159,9 @@ error: aborting due to previous error
Could not compile `hello_world`.
```

Rust will not let us use a value that has not been initialized. Next, let’s
talk about this stuff we've added to `println!`.
Rust will not let us use a value that has not been initialized.

Let take a minute to talk about this stuff we've added to `println!`.

If you include two curly braces (`{}`, some call them moustaches...) in your
string to print, Rust will interpret this as a request to interpolate some sort
Expand Down Expand Up @@ -222,8 +223,8 @@ To learn more, run the command again with --verbose.
```

Additionally, variable bindings can be shadowed. This means that a later
variable binding with the same name as another binding, that's currently in
scope, will override the previous binding.
variable binding with the same name as another binding that is currently in
scope will override the previous binding.

```rust
let x: i32 = 8;
Expand Down