Skip to content

Commit 8a8cccd

Browse files
committed
Explain potentially confusing string example.
Reported be @elbaha
1 parent e5f2021 commit 8a8cccd

File tree

1 file changed

+5
-4
lines changed

1 file changed

+5
-4
lines changed

doc/tutorial.md

Lines changed: 5 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -207,14 +207,15 @@ let hi = "hi";
207207
let mut count = 0;
208208
209209
while count < 10 {
210-
println!("count: {}", count);
210+
println!("count is {}", count);
211211
count += 1;
212212
}
213213
~~~~
214214

215-
Although Rust can almost always infer the types of local variables, you
216-
can specify a variable's type by following it with a colon, then the type
217-
name. Static items, on the other hand, always require a type annotation.
215+
Although Rust can almost always infer the types of local variables, you can
216+
specify a variable's type by following it in the `let` with a colon, then the
217+
type name. Static items, on the other hand, always require a type annotation.
218+
218219

219220
~~~~
220221
static MONSTER_FACTOR: f64 = 57.8;

0 commit comments

Comments
 (0)