|
|
@ -2,7 +2,6 @@ use std::fmt; |
|
|
|
use std::mem::transmute; |
|
|
|
use std::mem::transmute; |
|
|
|
use std::io::{Cursor, Read, Write}; |
|
|
|
use std::io::{Cursor, Read, Write}; |
|
|
|
use std::default::Default; |
|
|
|
use std::default::Default; |
|
|
|
use std::iter::FromIterator; |
|
|
|
|
|
|
|
use std::string::{String, FromUtf8Error}; |
|
|
|
use std::string::{String, FromUtf8Error}; |
|
|
|
use std::result::Result as StdResult; |
|
|
|
use std::result::Result as StdResult; |
|
|
|
use byteorder::{ByteOrder, NetworkEndian}; |
|
|
|
use byteorder::{ByteOrder, NetworkEndian}; |
|
|
@ -274,10 +273,7 @@ impl Frame { |
|
|
|
let u: u16 = code.into(); |
|
|
|
let u: u16 = code.into(); |
|
|
|
transmute(u.to_be()) |
|
|
|
transmute(u.to_be()) |
|
|
|
}; |
|
|
|
}; |
|
|
|
Vec::from_iter( |
|
|
|
[&raw[..], reason.as_bytes()].concat() |
|
|
|
raw[..].iter() |
|
|
|
|
|
|
|
.chain(reason.as_bytes().iter()) |
|
|
|
|
|
|
|
.map(|&b| b)) |
|
|
|
|
|
|
|
} else { |
|
|
|
} else { |
|
|
|
Vec::new() |
|
|
|
Vec::new() |
|
|
|
}; |
|
|
|
}; |
|
|
|