ninjasource / embedded-websocket

A rust websocket library for embedded systems (no_std)
Apache License 2.0
98 stars 28 forks source link

client example doesn't compile w/ latest rand #5

Closed jgarvin closed 3 years ago

jgarvin commented 3 years ago

rand 0.7.3 works fine, but rand 0.8.3 does not.

37  |     let mut ws_client = ws::WebSocketClient::new_client(rand::thread_rng());
    |                         ^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^^ the trait `rand_core::RngCore` is not implemented for `ThreadRng`
ninjasource commented 3 years ago

I guess the solution would be to bump the rand_core version to 0.6. Not the first time this has happened! I wish that I didn't have to depend on rand_core at all. I'll fix it and publish my changes tomorrow. The random number generator is only used to add entropy to the payload so that proxy servers don't cache the traffic. It does not have to be cryptographically strong so maybe using rand_core is overkill.

ninjasource commented 3 years ago

Ok, I've made the update. Let me know if this solves your problem and I'll close the issue. Thanks for raising the issue.

jgarvin commented 3 years ago

Awesome thanks 👍