Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Fix direct use of rand in derive macro #197

Merged
merged 3 commits into from
Oct 17, 2024
Merged

Conversation

FSMaxB
Copy link
Contributor

@FSMaxB FSMaxB commented Oct 14, 2024

I currently get the error failed to resolve: use of undeclared crate or module rand when deriving fake::Dummy.

This is caused by using rand directly in the code that the derive macro generates.

To fix this, I added a #[doc(hidden)] reexport of rand to the fake crate.

In another commit, I also added a missing :: to a use of std.

If you want, I can also remove the pub use rand::Rng and replace all ::fake::Rng uses with ::fake::rand::Rng but I didn't do it for now just to make the most non-invasive change.

@FSMaxB FSMaxB force-pushed the fix-rand-in-macro branch from 3a8d317 to d0963f0 Compare October 16, 2024 11:53
@FSMaxB
Copy link
Contributor Author

FSMaxB commented Oct 16, 2024

Sorry, I always forget that RustRover doesn't turn rustfmt on by default.

I fixed the formatting and also added a commit to fix the clippy lints.

@cksac cksac merged commit 23a753a into cksac:master Oct 17, 2024
5 checks passed
@FSMaxB FSMaxB deleted the fix-rand-in-macro branch October 17, 2024 07:25
@francisdb
Copy link

Can we please get a release with this included?

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants