cognitive-engineering-lab / rust-book

The Rust Programming Language: Experimental Edition
https://rust-book.cs.brown.edu
Other
506 stars 82 forks source link

Ch 2: Incorrect wording on type conversion explanation #88

Open VileLasagna opened 1 year ago

VileLasagna commented 1 year ago

URL to the section(s) of the book with this problem: https://rust-book.cs.brown.edu/ch02-00-guessing-game-tutorial.html

Description of the problem: Reading this sentence it does not make a lot of sense, I believe that the word "compare" is incorrect here

The trim method on a String instance will eliminate any whitespace at the beginning and end, which we must do to be able to compare the string to the u32, which can only contain numerical data.

Suggested fix:

The trim method on a String instance will eliminate any whitespace at the beginning and end, which we must do to be able to convert the string to the u32 type, which can only contain numerical data.