From 35f58a6026321409763ae6a76b41528408ed81f2 Mon Sep 17 00:00:00 2001 From: ledoge Date: Mon, 21 May 2018 15:05:37 +0200 Subject: [PATCH] Update ch02-00-guessing-game-tutorial.md Add missing `mut` and semicolon in text --- 2018-edition/src/ch02-00-guessing-game-tutorial.md | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/2018-edition/src/ch02-00-guessing-game-tutorial.md b/2018-edition/src/ch02-00-guessing-game-tutorial.md index 232ab93cd..f50334e9a 100644 --- a/2018-edition/src/ch02-00-guessing-game-tutorial.md +++ b/2018-edition/src/ch02-00-guessing-game-tutorial.md @@ -685,8 +685,8 @@ Could not compile `guessing_game`. The core of the error states that there are *mismatched types*. Rust has a strong, static type system. However, it also has type inference. When we wrote -`let guess = String::new()`, Rust was able to infer that `guess` should be a -`String` and didn’t make us write the type. The `secret_number`, on the other +`let mut guess = String::new();`, Rust was able to infer that `guess` should be +a `String` and didn’t make us write the type. The `secret_number`, on the other hand, is a number type. A few number types can have a value between 1 and 100: `i32`, a 32-bit number; `u32`, an unsigned 32-bit number; `i64`, a 64-bit number; as well as others. Rust defaults to an `i32`, which is the type of