-
Notifications
You must be signed in to change notification settings - Fork 54
feat: add minimal scaffolding for std feature
#161
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
base: master
Are you sure you want to change the base?
Conversation
bccd5f9 to
fb08aa6
Compare
zeenix
left a comment
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
LGTM but isn't this a breaking change?
|
Maybe (it does break building |
4dd839b to
51484cf
Compare
|
(Marked as draft because we need to wait for the current release to get finished) |
Yeah, adding a default feature that gates existing functionality/api, is a breaking change for sure. |
src/lib.rs
Outdated
| #[cfg(feature = "std")] | ||
| let mut rng = fastrand::Rng::new(); | ||
| #[cfg(not(feature = "std"))] | ||
| let mut rng = fastrand::Rng::with_seed(0); |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
I would recommend using either a pre-set value other than 0 or the address of a function as the seed here.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is this better (unfortunately, one can't use the address of the current function, because it's async and is unnameable (at least I couldn't find a way to state it).
Co-authored-by: Έλλεν Εμίλια Άννα Zscheile <fogti+devel@ytrizja.de>
Cherry-picked 78cfea8.
Note that this doesn't make
async-executoractually work in ano-stdsetting by default (due to lack of locks, etc.), but it puts all the stuff in place that will always be necessary, no matter which lock implementation is actually used.