mirror of
https://github.com/servo/servo.git
synced 2025-07-23 07:13:52 +01:00
Cleanup write_json_packet.
This commit is contained in:
parent
366d4a83f1
commit
62a98e4918
1 changed files with 1 additions and 3 deletions
|
@ -22,9 +22,7 @@ impl JsonPacketStream for TcpStream {
|
|||
fn write_json_packet<'a, T: Encodable>(&mut self, obj: &T) {
|
||||
let s = json::encode(obj).unwrap().replace("__type__", "type");
|
||||
println!("<- {}", s);
|
||||
self.write_all(s.len().to_string().as_bytes()).unwrap();
|
||||
self.write_all(&[':' as u8]).unwrap();
|
||||
self.write_all(s.as_bytes()).unwrap();
|
||||
write!(self, "{}:{}", s.len(), s).unwrap();
|
||||
}
|
||||
|
||||
fn read_json_packet<'a>(&mut self) -> Result<Option<Json>, String> {
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue