fix: import rand::RngExt so pick compiles after rand 0.10 bump#223
Open
andrew-tawfeek wants to merge 1 commit into
Open
fix: import rand::RngExt so pick compiles after rand 0.10 bump#223andrew-tawfeek wants to merge 1 commit into
andrew-tawfeek wants to merge 1 commit into
Conversation
The rand 0.10 bump (clearloop#220) moved `random_range` off the `Rng` trait into the new `RngExt` trait, so `src/cmd/pick.rs` no longer compiles on `main`: error[E0599]: no method named `random_range` found for struct `ThreadRng` help: trait `RngExt` which provides `random_range` is implemented but not in scope; perhaps you want to import it Import `RngExt` instead of `Rng` in the `pick` handler.
2865f09 to
109730f
Compare
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
maincurrently fails to compile. Therand0.10 upgrade in #220 movedrandom_rangeoff theRngtrait and into the newRngExttrait, butsrc/cmd/pick.rsstill importsrand::Rng:cargo build --releasefails on a clean checkout ofmain.This is fixed by importing
rand::RngExtinstead ofrand::Rngin thepickhandler — that's the trait now providingrandom_rangein rand 0.10. It's verified by checkingcargo build --releasesucceeds, andleetcode pick(random pick) works as before.