Skip to content

crypto-common: add UnwrapSysRng alias#2240

Closed
tarcieri wants to merge 1 commit intomasterfrom
crypto-common/add-unwrap-sys-rng
Closed

crypto-common: add UnwrapSysRng alias#2240
tarcieri wants to merge 1 commit intomasterfrom
crypto-common/add-unwrap-sys-rng

Conversation

@tarcieri
Copy link
Member

Though I think the Generate trait covers a lot of use cases, for anyone who wants to use SysRng with CryptoRng this is a little more convenient than importing both SysRng and Unwrap and assembling it yourself.

Though I think the `Generate` trait covers a lot of use cases, for
anyone who wants to use `SysRng` with `CryptoRng` this is a little more
convenient than importing both `SysRng` and `Unwrap` and assembling it
yourself.
@tarcieri tarcieri requested a review from newpavlov January 25, 2026 20:00
@newpavlov
Copy link
Member

newpavlov commented Jan 25, 2026

I don't think we should implement it ourselves. I tried to add it to getrandom, but it was rejected, see: rust-random/getrandom#754

Also note that creating value of the aliased type would be less convenient than with SysRng, i.e. you would have to write UnwrapSysRng::default().

cc @dhardy @josephlr

@tarcieri
Copy link
Member Author

Oh hey look at that you proposed the same thing. Yeah, the main thing that's nice is it cuts the two imports down to one.

@tarcieri
Copy link
Member Author

I'll close this for now and if it gets upstream it gets upstream, I guess

@tarcieri tarcieri closed this Jan 26, 2026
@tarcieri tarcieri deleted the crypto-common/add-unwrap-sys-rng branch January 26, 2026 16:24
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