Conversation
| pub fn fill_inner(dest: &mut [MaybeUninit<u8>]) -> Result<(), Error> { | ||
| for byte in dest { | ||
| byte.write(0); | ||
| } | ||
| Ok(()) | ||
| } |
Do you have a suggestion for a better name?
There are cases where it's completely fine. It doesn't seem like it's pretending when it's in the description? |
|
Maybe a better solution would be to have an implementation that does a runtime panic or error? Again, in my case this code is never hit/run. I just need it to compile for wasm32-unknown-unkown without creating a bunch of bloat or changing the wasm module's interface. |
|
I opened #667 as an alternative. |
It's not about what this backend claims to do; it's about what getrandom claims to do:
Who knows if someone might accidentally build deployment code using this backend? Your alternative looks more acceptable. |
There are times when I go to use a crate in Wasm and some dependency of a dependency uses this crate for randomness, but I'm not using the functionality that needs the randomness. Providing a custom backend doesn't work because then it creates a wasm export and I want my wasm interface clean. For scenarios like this, it's useful to be able to just have this crate not provide any randomness at all.