Remove unnecessary transmute in generate_mask()

rand::Rand has
    impl<T> Rand for [T; 16] where T: Rand
so we don't need to simulate it ourselves.
pull/7/head
Ran Benita 8 years ago
parent ca2d2ce313
commit ea4b5e4df0
  1. 2
      src/protocol/frame/frame.rs

@ -22,7 +22,7 @@ fn apply_mask(buf: &mut [u8], mask: &[u8; 4]) {
#[inline] #[inline]
fn generate_mask() -> [u8; 4] { fn generate_mask() -> [u8; 4] {
unsafe { transmute(rand::random::<u32>()) } rand::random()
} }
/// A struct representing a WebSocket frame. /// A struct representing a WebSocket frame.

Loading…
Cancel
Save