From 36e2c100bfae61c8d7bc275829b4c9c9e66e7062 Mon Sep 17 00:00:00 2001 From: Brian Anderson Date: Thu, 20 Dec 2012 03:18:11 -0800 Subject: [PATCH] tutorial: Integrate constants into main intro text --- doc/tutorial.md | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-) diff --git a/doc/tutorial.md b/doc/tutorial.md index 6fc379b6c67..5132cdd6014 100644 --- a/doc/tutorial.md +++ b/doc/tutorial.md @@ -221,11 +221,11 @@ qualified name. For more details, see the section on [crates](#crates). 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. +name. Constants, an the other hand, always require a type annotation. ~~~~ -let monster_size: float = 57.8; -let imaginary_size = monster_size * 10.0; +const monster_factor: float = 57.8; +let monster_size: float = monster_factor * 10.0; let monster_size: int = 50; ~~~~