From 8b4b7974d54737aad81a8de9f8e7742533f566ca Mon Sep 17 00:00:00 2001 From: =?UTF-8?q?G=C3=B6khan=20Karabulut?= Date: Sun, 26 Apr 2020 14:38:25 +0300 Subject: [PATCH] Fix guessing game listing explanation Due to running rustfmt on code listings, explanation and listing does not match in guessing game chapter. Fix this mismatch. --- src/ch02-00-guessing-game-tutorial.md | 7 +++---- 1 file changed, 3 insertions(+), 4 deletions(-) diff --git a/src/ch02-00-guessing-game-tutorial.md b/src/ch02-00-guessing-game-tutorial.md index b09dade72f..ec715dc3ec 100644 --- a/src/ch02-00-guessing-game-tutorial.md +++ b/src/ch02-00-guessing-game-tutorial.md @@ -650,7 +650,7 @@ cannot compare a string and a number type. Ultimately, we want to convert the `String` the program reads as input into a real number type so we can compare it numerically to the secret number. We can -do that by adding the following two lines to the `main` function body: +do that by adding another line to the `main` function body: Filename: src/main.rs @@ -658,11 +658,10 @@ do that by adding the following two lines to the `main` function body: {{#rustdoc_include ../listings/ch02-guessing-game-tutorial/no-listing-03-convert-string-to-number/src/main.rs:here}} ``` -The two new lines are: +The line is: ```rust,ignore -let guess: u32 = guess.trim().parse() - .expect("Please type a number!"); +let guess: u32 = guess.trim().parse().expect("Please type a number!"); ``` We create a variable named `guess`. But wait, doesn’t the program already have