diff options
| author | Corey Richardson <corey@octayn.net> | 2013-12-06 01:26:49 -0500 |
|---|---|---|
| committer | Corey Richardson <corey@octayn.net> | 2013-12-10 07:28:24 -0500 |
| commit | 8a8cccd4b60d85498c99c14141a1dab1c9e5cf5a (patch) | |
| tree | 6aeed6cf533fbdeebdb2c5f4ce22d13b9f034f08 /doc/tutorial.md | |
| parent | e5f20212028fd6cb5161dbb2c0f14c9d94f1caea (diff) | |
| download | rust-8a8cccd4b60d85498c99c14141a1dab1c9e5cf5a.tar.gz rust-8a8cccd4b60d85498c99c14141a1dab1c9e5cf5a.zip | |
Explain potentially confusing string example.
Reported be @ElBaha
Diffstat (limited to 'doc/tutorial.md')
| -rw-r--r-- | doc/tutorial.md | 9 |
1 files changed, 5 insertions, 4 deletions
diff --git a/doc/tutorial.md b/doc/tutorial.md index 58bfd047d95..dee1f1334ef 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -207,14 +207,15 @@ let hi = "hi"; let mut count = 0; while count < 10 { - println!("count: {}", count); + println!("count is {}", count); count += 1; } ~~~~ -Although Rust can almost always infer the types of local variables, you -can specify a variable's type by following it with a colon, then the type -name. Static items, on the other hand, always require a type annotation. +Although Rust can almost always infer the types of local variables, you can +specify a variable's type by following it in the `let` with a colon, then the +type name. Static items, on the other hand, always require a type annotation. + ~~~~ static MONSTER_FACTOR: f64 = 57.8; |
