rust-lang / book

The Rust Programming Language
https://doc.rust-lang.org/book/
Other
15k stars 3.39k forks source link

Wrong verb in Chapter 2? #3921

Closed pygospa closed 4 months ago

pygospa commented 4 months ago

Hi, just a really small thing I stumbled upon; is the verb compare correct?

which we must do to be able to compare the string to the u32

or should it rather be convert. Is Rust doing a comparison? And if so, what exactly is compared?

https://github.com/rust-lang/book/blob/7e2a00d5d0ddc01d0f20bb9bf408ff1b533662e3/src/ch02-00-guessing-game-tutorial.md?plain=1#L683C69-L683C76

chriskrycho commented 4 months ago

Thanks for the question. “Compare” is indeed correct here: there is a conversion which happens, but recall that the reason for the conversion is to be able to compare the answer from the user to the number generated by the game. Thanks!