Use non deprecated functions in Chapter 2. Programming a Guessing Game#4217
Use non deprecated functions in Chapter 2. Programming a Guessing Game#4217TexanDoomGuy wants to merge 13 commits into
Conversation
|
Dont forget to update the rand version shown in the chapter too along with the |
|
Thank you! I’ll take a look at this later this week as part of my work to prepare the book for the 2024 Edition release! |
chriskrycho
left a comment
There was a problem hiding this comment.
These changes are solid—thank you! We need a few more to be able to land this:
-
A better title for this is “Update to use
rand0.9 throughout”. Those functions are not deprecated on the version that the book is using, after all! -
We do indeed need to update all instances of
rand = "0.8.5"torand = "0.9.0"in theCargo.tomlfiles throughout.1 That includes in the text immediately after including Listing 2-2, which itself shows addingrandto theCargo.tomlfile.That will also flag up the need for some changes in Chapter 14!
-
We also need to update the sections Ensuring Reproducible Builds with the Cargo.lock File and Updating a Crate to Get a New Version in Ch. 2 to use 0.9.0 as the starting point and 0.9.1 and 0.10.0 as the “new versions” in the text, in the
manual-regenerationcomment, and in the code samples.
Footnotes
-
It’s quite surprising to me that this is passing CI at the moment! But that’s an issue with something about how we’re running
mdbook testand not specific to this PR. I will follow up on that in parallel to our landing this. ↩
|
Sorry, I've been a little busy. I'll get that done soon. |
|
I don't think I can have time for this currently. I've gotten a lot of work from school. |
|
@chriskrycho I opened a new PR for this HERE |
Chapter 2. Programming a Guessing Game uses
thread_rng()andgen_range(), which are deprecated.I replaced every
thread_rng()withrng(), and everygen_range()withrandom_range()The function is also referenced in a few other areas, of which I updated.