Skip to content

Conversation

@dhardy
Copy link
Member

@dhardy dhardy commented Jan 12, 2026

  • Added a CHANGELOG.md entry

Summary

Revise the core traits according to @newpavlov's suggestion and similar to #41 but keeping the infallible methods.

No trait renames are done in this PR. Also not sure if we need any.

Details

  • TryRngCore is implemented for any R: DerefMut where Target: TryRngCore.
  • RngCore: TryRngCore<Error = Infallible> with automatic implementation over TryRngCore
  • UnwrapMut is removed
  • CryptoRng = RngCore + TryCryptoRng or as close as possible without sum traits; it is kept since I believe some people need dyn CryptoRng
  • utils::{next_u64_via_u32, next_word_via_fill} now use closures instead of R: RngCore

Questions

Should utils fns support potentially-fallible uses (try_next_u64_via_u32 takes FnMut() -> Result<u32; E> for generic E)? I think unnecessary.

@dhardy dhardy mentioned this pull request Jan 12, 2026
3 tasks
@dhardy
Copy link
Member Author

dhardy commented Jan 13, 2026

Updated. Some things need further discussion (see above).

@dhardy dhardy changed the title Let RngCore: TryRngCore Let RngCore: TryRngCore<Error = Infallible> Jan 14, 2026
@dhardy dhardy merged commit 48d9605 into master Jan 14, 2026
13 checks passed
@dhardy dhardy deleted the push-zqznkttsmlvp branch January 14, 2026 18:37
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