Merge pull request #39 from bluetech/clippy

Small clippy fixes
pull/62/head
Daniel Abramov 7 years ago committed by GitHub
commit 2cfc7ea09e
No known key found for this signature in database
GPG Key ID: 4AEE18F83AFDEB23
  1. 2
      src/handshake/client.rs
  2. 2
      src/handshake/server.rs
  3. 4
      src/protocol/frame/coding.rs
  4. 2
      src/protocol/frame/mask.rs
  5. 1
      src/protocol/message.rs

@ -135,7 +135,7 @@ impl<S: Read + Write> HandshakeRole for ClientHandshake<S> {
stream,
tail,
Role::Client,
self.config.clone(),
self.config,
);
ProcessingResult::Done((websocket, result))
}

@ -156,7 +156,7 @@ impl<S: Read + Write, C: Callback> HandshakeRole for ServerHandshake<S, C> {
let websocket = WebSocket::from_raw_socket(
stream,
Role::Server,
self.config.clone(),
self.config,
);
ProcessingResult::Done(websocket)
}

@ -183,8 +183,8 @@ pub enum CloseCode {
impl CloseCode {
/// Check if this CloseCode is allowed.
pub fn is_allowed(&self) -> bool {
match *self {
pub fn is_allowed(self) -> bool {
match self {
Bad(_) => false,
Reserved(_) => false,
Status => false,

@ -29,7 +29,7 @@ fn apply_mask_fallback(buf: &mut [u8], mask: [u8; 4]) {
#[allow(dead_code)]
fn apply_mask_fast32(buf: &mut [u8], mask: [u8; 4]) {
let mask_u32: u32 = unsafe {
read_unaligned(mask.as_ptr() as *const u32)
read_unaligned((&mask).as_ptr() as *const u32)
};
let mut ptr = buf.as_mut_ptr();

@ -159,6 +159,7 @@ impl IncompleteMessage {
}
/// The type of incomplete message.
#[derive(Copy, Clone)]
pub enum IncompleteMessageType {
Text,
Binary,

Loading…
Cancel
Save