Skip to content

Commit 36e2c10

Browse files
committed
tutorial: Integrate constants into main intro text
1 parent e06ca65 commit 36e2c10

File tree

1 file changed

+3
-3
lines changed

1 file changed

+3
-3
lines changed

doc/tutorial.md

Lines changed: 3 additions & 3 deletions
Original file line numberDiff line numberDiff line change
@@ -221,11 +221,11 @@ qualified name. For more details, see the section on [crates](#crates).
221221

222222
Although Rust can almost always infer the types of local variables, you
223223
can specify a variable's type by following it with a colon, then the type
224-
name.
224+
name. Constants, an the other hand, always require a type annotation.
225225

226226
~~~~
227-
let monster_size: float = 57.8;
228-
let imaginary_size = monster_size * 10.0;
227+
const monster_factor: float = 57.8;
228+
let monster_size: float = monster_factor * 10.0;
229229
let monster_size: int = 50;
230230
~~~~
231231

0 commit comments

Comments
 (0)