Skip to content

Conversation

@josephlr
Copy link
Contributor

@josephlr josephlr commented Jun 18, 2019

We can do the same overflow check but in a much more readable/efficient way. This also helps toward overall simplification of rand.rs and the eventual elimination of mod sysrand_chunk (see followup).

Also removes polyfill::usize_from_u32 as we already check compatiblity in the assert!() (so we know the as cast is safe). We should probably cleanup polyfill anyway, as most of the proposed features have gone in a different direction or are unlikely to ever be stabilized.

@josephlr josephlr force-pushed the windows branch 2 times, most recently from 7ebe027 to a7e4b58 Compare June 18, 2019 11:22
@briansmith
Copy link
Owner

I don't have time to consider this now. Thanks though!

@briansmith briansmith closed this Jul 10, 2019
@josephlr josephlr deleted the windows branch July 10, 2019 04:22
@josephlr
Copy link
Contributor Author

I don't have time to consider this now. Thanks though!

That fine! This is just one of many changes from getrandom that could be incorporated into ring, but those should be addressed wholesale after rust-lang/rust#62082 is resolved.

@josephlr josephlr mentioned this pull request Jul 12, 2019
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.

2 participants